Toggle div with Angular 6

╄→гoц情女王★ 提交于 2019-12-24 07:46:18

问题


I'm new to Angular and want to start with something simple to learn.

I'm currently developing a form and have divs which I need to toggle upon user selection. Do I need to create Angular 6 component to create such a toggle function?

How can I do the toggle - whether with component or without (if possible)?

Thanks


回答1:


You could try something like:

const isOpened = true;

<div *ngIf="isOpened">
<form> </form>
<div>

<div *ngIf="!isOpened">
<form> </form>
<div>


来源:https://stackoverflow.com/questions/50946102/toggle-div-with-angular-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!