| .. | .. |
|---|
| 1 | 1 | import { LocaleService } from './common/i18n'; |
|---|
| 2 | 2 | import { ActivatedRoute, Router } from '@angular/router'; |
|---|
| 3 | 3 | 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'; |
|---|
| 5 | 5 | import { IPageChangeEvent } from '@covalent/core'; |
|---|
| 6 | | -import { Component, AfterViewInit } from '@angular/core'; |
|---|
| 6 | +import { Component, AfterViewInit, ViewChild } from '@angular/core'; |
|---|
| 7 | 7 | import { TdMediaService } from '@covalent/core'; |
|---|
| 8 | 8 | import { LicensesService } from './resources/licenses'; |
|---|
| 9 | 9 | import { PacksService } from './resources/packs'; |
|---|
| 10 | +import { Location } from '@angular/common'; |
|---|
| 10 | 11 | |
|---|
| 11 | 12 | import { LicenseFormComponent } from './forms/license.form.component'; |
|---|
| 12 | 13 | |
|---|
| .. | .. |
|---|
| 37 | 38 | }) |
|---|
| 38 | 39 | export class LicenseListComponent implements AfterViewInit { |
|---|
| 39 | 40 | data: any[] = []; |
|---|
| 41 | + @ViewChild('pagingBar') pagingBar : TdPagingBarComponent ; |
|---|
| 42 | + |
|---|
| 40 | 43 | pack: any = null; |
|---|
| 41 | 44 | columns: ITdDataTableColumn[] = [ |
|---|
| 42 | 45 | { name: 'code', label: 'Code', tooltip: 'License code' }, |
|---|
| .. | .. |
|---|
| 79 | 82 | private media: TdMediaService, |
|---|
| 80 | 83 | private $L: LocaleService, |
|---|
| 81 | 84 | private router: Router, |
|---|
| 85 | + private location: Location, |
|---|
| 82 | 86 | private route: ActivatedRoute, |
|---|
| 83 | 87 | private dialog: MdDialog, |
|---|
| 84 | 88 | private licenseForm: LicenseFormComponent, |
|---|
| .. | .. |
|---|
| 105 | 109 | }); |
|---|
| 106 | 110 | } |
|---|
| 107 | 111 | |
|---|
| 112 | + goBack() : void { |
|---|
| 113 | + this.location.back(); |
|---|
| 114 | + } |
|---|
| 115 | + |
|---|
| 108 | 116 | isLicenseExpired(lic: any): boolean { |
|---|
| 109 | 117 | return lic.expiration_date < (new Date().getTime()); |
|---|
| 110 | 118 | } |
|---|