import { Router, ActivatedRoute } from '@angular/router'; import { MdDialog, MdDialogConfig } from '@angular/material'; import { ITdDataTableColumn, ITdDataTableSortChangeEvent, TdDataTableService, TdDataTableSortingOrder, TdPagingBarComponent } from '@covalent/core'; import { IPageChangeEvent } from '@covalent/core'; import { Component, ViewChild, AfterViewInit } from '@angular/core'; import { TdMediaService } from '@covalent/core'; import { OrganizationsService } from '../resources/organizations'; import { PackFormComponent } from '../forms/pack.form.component'; import { LocaleService } from '../common/i18n'; import { ListingBase } from './base'; var app_example = { code: 'CICS', creation_timestamp: 1418384439000, description: 'Wellbore integrity analysis software', id: 1, license_filename: 'config_server.lic', name: 'CurisIntegrity', metadata: [ { key: 'max_docs', value: '250000', readonly: true, mandatory: true } ] } @Component({ selector: 'organization-list', templateUrl: 'src/app/listing/organization.list.component.html' }) export class OrganizationListComponent extends ListingBase implements AfterViewInit { columns: ITdDataTableColumn[] = [ { name: 'code', label: 'Code', tooltip: 'Organization code' }, { name: 'name', label: 'Application name' }, { name: 'creation_timestamp', label: 'Creation date' }, { name: 'menu', label: '' } ]; pack_menu_options : any[] = [{ command: 'edit', name: 'Edit' },{ command: 'cancel', name: 'Cancel' }] constructor(_dataTableService: TdDataTableService, private media: TdMediaService, private router: Router, private $L: LocaleService, private applicationForm: PackFormComponent, private organizations: OrganizationsService) { super(_dataTableService); this.organizations.get().subscribe( (list : any[]) => { this.data = list; this.refresh(); }, (err: any) => console.error(err) ); } packAction(action: any) { console.log(action.command); } isActionAvailable(pack : any) : boolean { return true; } create() : void { this.router.navigate(['organizations/create']); } edit(eleId: number | string) : void { this.router.navigate([`organizations/edit/${eleId}`]); } }