I am trying to filter out some items by *ngIf on a list achieved by looping, but it is giving error. Kindly help.
abc.component.html
<ul>
<li *ngFor="let x of students" *ngIf="x.age < 30">{{x.name}},{{x.age}}</li>
</ul>
abc.component.ts
students = [
{name: "Jack", age: 29, gender:"male", country: "USA"},
{name: "Ronald", age: 33, gender: "male", country: "UK"},
{name: "Lisa", age: 19, gender: "female", country: "UK"},
{name: "Donald", age: 43, gender: "male", country: "Austrailia"},
{name: "Simera", age: 23, gender: "female", country: "Italy"}
];
Error:
Kindly, help in filtering out rows of li items based on age < 30 in the above example. Thank You.