angular 8 conditional style code example
Example: conditional inline style angular
// ngStyle (conditional Style)
1? 'green': 'red'"> {{i}} {{data.title}}
//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