Angularjs is a front end library for create beautiful interactive web application using Nodejs ( JavaScript). If you are familiar with Reactjs , may catch it faster.
conditional place component
In Angular we can place components conditionally, this can be done by
- Create a property
- use ngIf
First up all create simple property for enabling and disabling. It can be true or false property.
enableFeature=flase
Now you can place ngif with in the any tag/component. In our case it is just a h1 tag.
<h1 *ngIf="enableFeature">{{'You slected ' + brandSelected}} </h1>
What does this means ?
The heading will only show up if the enableFeature is set to true
Keep reading Angular posts
- How to generate model class in angular using CLI - How to generate angular Model class using CLI
- How to generate angular components using CLI - How to generate angular component using CLI
- How to create and run angular project in easy steps - How to create a angularjs project and run in easy steps
- How to display list of data in Angular component template - Angular : How to render a list of data in html template in Angular
- Conditionally place component in Angular - Angular : How to place a tag/ component conditionally
- Component interaction in Angularjs – Part I - How to send data to a child component in Angularjs
- Angularjs component styling Part III : using ngClass - How to apply a set of styles using ngClass in Angularjs
- Angularjs component styling Part III : conditionally bind class - How to style Angularjs components using class binding
- Angularjs component styling Part II : binding class - How to style Angularjs components using class binding
- Angularjs component styling Part I - How to style Angularjs components