| .. | .. |
|---|
| 10 | 10 | TdPagingBarComponent |
|---|
| 11 | 11 | } from '@covalent/core'; |
|---|
| 12 | 12 | import { IPageChangeEvent } from '@covalent/core'; |
|---|
| 13 | | -import { Component, ViewChild, AfterViewInit } from '@angular/core'; |
|---|
| 14 | | -import { TdMediaService } from '@covalent/core'; |
|---|
| 13 | +import { Component, ViewChild, AfterViewInit, Inject } from '@angular/core'; |
|---|
| 14 | +import { TdMediaService} from '@covalent/core'; |
|---|
| 15 | 15 | import { PacksService, PACK_ACTIONS, PacksFilter } from '../resources/packs'; |
|---|
| 16 | 16 | import { PackFormComponent } from '../forms/pack.form.component'; |
|---|
| 17 | 17 | import { LocaleService } from '../common/i18n'; |
|---|
| 18 | 18 | import { ListingBase } from './base'; |
|---|
| 19 | +import { Injector } from '@angular/core'; |
|---|
| 19 | 20 | |
|---|
| 20 | 21 | /** |
|---|
| 21 | 22 | var pack_example = { |
|---|
| .. | .. |
|---|
| 53 | 54 | }) |
|---|
| 54 | 55 | export class PackListComponent extends ListingBase implements AfterViewInit { |
|---|
| 55 | 56 | |
|---|
| 57 | + private packs: PacksService; |
|---|
| 58 | + |
|---|
| 56 | 59 | columns: ITdDataTableColumn[] = [ |
|---|
| 57 | 60 | { name: 'code', label: 'Code', tooltip: 'License pack code' }, |
|---|
| 58 | 61 | { name: 'application_name', label: 'App name' }, |
|---|
| .. | .. |
|---|
| 67 | 70 | filter_description : string; |
|---|
| 68 | 71 | prevUrl : string = null; |
|---|
| 69 | 72 | |
|---|
| 70 | | - constructor(_dataTableService: TdDataTableService, |
|---|
| 73 | + constructor(private injector: Injector, |
|---|
| 74 | + _dataTableService: TdDataTableService, |
|---|
| 71 | 75 | private media: TdMediaService, |
|---|
| 72 | 76 | private router: Router, |
|---|
| 73 | 77 | private route: ActivatedRoute, |
|---|
| 74 | 78 | private dialog: MdDialog, |
|---|
| 75 | 79 | private $L: LocaleService, |
|---|
| 76 | | - private toaster: ToastsManager, |
|---|
| 77 | | - private packForm: PackFormComponent, |
|---|
| 78 | | - private packs: PacksService) { |
|---|
| 79 | | - super(_dataTableService); |
|---|
| 80 | + private toaster: ToastsManager) { |
|---|
| 81 | + super(_dataTableService); |
|---|
| 82 | + this.packs = this.injector.get(PacksService); |
|---|
| 80 | 83 | } |
|---|
| 81 | 84 | |
|---|
| 82 | 85 | reload(filter?: PacksFilter) : void { |
|---|