Skip to content Skip to sidebar Skip to footer

Angular: Conditional Element In Dom?

In AngularJS, how would I make a HTML exist only if a scope variable is true? I know there is the ng-show directive but this will not work for me as it will only make it invisible

Solution 1:

You can use Angular's ng-if directive (see the docs):

<divng-if="myvar==myothervar"></div>

Solution 2:

https://docs.angularjs.org/api/ng/directive/ngIf

is what you are looking all over

may be what shall give you what you are looking for. Check you angular version though.

Post a Comment for "Angular: Conditional Element In Dom?"