rsanchez
2017-03-15 68bfeadaca5c3af78a9884614dfec7a188454a2f
securis/src/main/webapp/src/app/license.list.component.ts
....@@ -1,12 +1,13 @@
11 import { LocaleService } from './common/i18n';
22 import { ActivatedRoute, Router } from '@angular/router';
33 import { MdDialog, MdDialogConfig } from '@angular/material';
4
-import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core';
4
+import { TdDataTableService, TdPagingBarComponent, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core';
55 import { IPageChangeEvent } from '@covalent/core';
6
-import { Component, AfterViewInit } from '@angular/core';
6
+import { Component, AfterViewInit, ViewChild } from '@angular/core';
77 import { TdMediaService } from '@covalent/core';
88 import { LicensesService } from './resources/licenses';
99 import { PacksService } from './resources/packs';
10
+import { Location } from '@angular/common';
1011
1112 import { LicenseFormComponent } from './forms/license.form.component';
1213
....@@ -37,6 +38,8 @@
3738 })
3839 export class LicenseListComponent implements AfterViewInit {
3940 data: any[] = [];
41
+ @ViewChild('pagingBar') pagingBar : TdPagingBarComponent ;
42
+
4043 pack: any = null;
4144 columns: ITdDataTableColumn[] = [
4245 { name: 'code', label: 'Code', tooltip: 'License code' },
....@@ -79,6 +82,7 @@
7982 private media: TdMediaService,
8083 private $L: LocaleService,
8184 private router: Router,
85
+ private location: Location,
8286 private route: ActivatedRoute,
8387 private dialog: MdDialog,
8488 private licenseForm: LicenseFormComponent,
....@@ -105,6 +109,10 @@
105109 });
106110 }
107111
112
+ goBack() : void {
113
+ this.location.back();
114
+ }
115
+
108116 isLicenseExpired(lic: any): boolean {
109117 return lic.expiration_date < (new Date().getTime());
110118 }