Check out example codes for "angular conditional directives". It will help you in understanding the concepts better.

Code Example 1

<div *ngIf='[condition]'> </div>   
  //if [condition]==true the div will be shown

<div *ngFor='let [data] of [dataArray]; let i=index;'>
  <h2> {{i}} {{data.title}} </h2>
  <img src='{{data.image}}' />
  //the data contained in an array will be displayed element by element
  //similar to the function .map() in React

// ngStyle (conditional Style)
<div *ngFor='let [data] of [dataArray]; let i=index;'>
  <h2 [style.background]="i>1? 'green': 'red'"> {{i}} {{data.title}} </h2>


//if the index of the element is 1 or 0, the background will be red, if it is over 1 the background will be green

Learn ReactJs, React Native from