add column sorting
[portal/ric-dashboard.git] / webapp-frontend / src / app / catalog / catalog.component.ts
index 96e040e..04b8380 100644 (file)
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-import { Component, OnInit} from '@angular/core';
-import { XappMgrService } from '../services/xapp-mgr/xapp-mgr.service';
-import { ConfirmDialogService } from './../services/ui/confirm-dialog.service'
-import { NotificationService } from './../services/ui/notification.service'
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { MatSort } from '@angular/material/sort';
 import { ErrorDialogService } from '../services/ui/error-dialog.service';
+import { XappMgrService } from '../services/xapp-mgr/xapp-mgr.service';
+import { ConfirmDialogService } from './../services/ui/confirm-dialog.service';
+import { NotificationService } from './../services/ui/notification.service';
 import { CatalogDataSource } from './catalog.datasource';
 
 @Component({
@@ -33,6 +34,7 @@ export class CatalogComponent implements OnInit{
 
   displayedColumns: string[] = ['name', 'version', 'status', 'action'];
   dataSource: CatalogDataSource;
+  @ViewChild(MatSort) sort: MatSort;
 
   constructor(
     private xappMgrSvc: XappMgrService,
@@ -41,7 +43,7 @@ export class CatalogComponent implements OnInit{
     private notification: NotificationService) { }
 
   ngOnInit() {
-    this.dataSource = new CatalogDataSource(this.xappMgrSvc);
+    this.dataSource = new CatalogDataSource(this.xappMgrSvc, this.sort );
     this.dataSource.loadTable();
   }