I am developing angular2 application with typescript. I need to filter Users by corresponding to input text box.
Table after filtering data
HTML Table view users.html
<tr *ngFor='let user of Users'>
<td>
<img [src]='user.imageUrl' [title]='user.userName' [style.width.px]='imageWidth' [style.margin.px]='imageMargin'>
</td>
<td>{{ user.userName }}</td>
</tr>
User List user-list.componet.ts
export class UserListComponent implements OnInit {
imageWidth: number = 50;
imageMargin: number = 2;
users: User[] = [
{
"productId": 2,
"productName": "Njjosgaaj",
}
];
ngOnInit(): void {
console.log('In OnInit');
}
}
User Interface user.ts
export interface User {
userId: number;
userName: string;
}
I tried to develop this using angular2 custom pipe. I am wondering about development? What is the best way of development this feature?