This commit is contained in:
Amritanshu
2019-06-20 00:17:44 +05:30
parent 2b2624c9c2
commit 93743bdc8e
27 changed files with 171 additions and 133 deletions
@@ -0,0 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { UserListDataSource } from './user-list-datasource';
import { User } from '../../core/user';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-user-list',
templateUrl: './user-list.component.html',
styleUrls: ['./user-list.component.css']
})
export class UserListComponent implements OnInit {
dataSource: UserListDataSource;
list: User[];
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['name', 'lockedOut', 'roles'];
constructor(private route: ActivatedRoute) {
}
ngOnInit() {
this.route.data
.subscribe((data: { list: User[] }) => {
this.list = data.list;
});
this.dataSource = new UserListDataSource(this.list);
}
}