Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const pendingUsers: pendingUsersData [] = [{
- 'autoReLogin': false,
- 'rolesAccess': [{
- 'requestReason': 'because i need it',
- 'status': 'pending',
- 'role': 'API_ApplicationDeveloper'
- }],
- 'userId': 'f123132',
- 'emailId': 'me@google.com',
- 'firstName': 'Me',
- 'lastName': 'ME',
- 'country': 'IN'
- }, {
- 'autoReLogin': false,
- 'rolesAccess': [{
- 'requestReason': ' ',
- 'status': 'pending',
- 'role': 'API_ApplicationDeveloper'
- }],
- 'userId': 'F12455',
- 'emailId': 'ak@gmail.com',
- 'firstName': 'AKl',
- 'lastName': 'M',
- 'country': 'IN'
- }, {
- 'autoReLogin': false,
- 'rolesAccess': [{
- 'requestReason': ' ',
- 'status': 'pending',
- 'role': 'API_ApplicationDeveloper'
- }],
- 'userId': 'F14123',
- 'emailId': 'pg@gmail.com',
- 'firstName': 'Prs',
- 'lastName': 'Gpta',
- 'country': 'IN'
- }, {
- 'autoReLogin': false,
- 'rolesAccess': [{
- 'requestReason': 'exception_response_reason',
- 'status': 'pending',
- 'role': 'API_ApplicationDeveloper'
- }],
- 'userId': 'F99349',
- 'emailId': 'ank.sh@gmail.com',
- 'firstName': 'Ank',
- 'lastName': 'Shy',
- 'country': 'IN'
- }];
- ngAfterViewInit() {
- this.pendingUsersDataSource.paginator = this.paginator.toArray()[0];
- this.pendingUsersDataSource.sort = this.sort.toArray()[0];
- this.pendingUsersDataSource.sortingDataAccessor = (item, property) => {
- switch (property) {
- case 'rolesAccess[0].requestReason': return item.rolesAccess[0].requestReason;
- default: return item[property];
- }
- };
- this.dataSource.sortingDataAccessor = (item, property) => {
- if (property.includes('.')) return property.split('.').reduce((o,i)=>o[i], item);
- return item[property];
- };
Add Comment
Please, Sign In to add comment