rsanchez
2017-03-14 38b0782c887f046426c31766901906c614d73140
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { Http } from '@angular/http';
import { LicensesService } from '../resources/licenses';
import { LocaleService } from '../common/i18n';
import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core';
import { IPageChangeEvent } from '@covalent/core';
import { Component, AfterViewInit } from '@angular/core';
import { TdMediaService } from '@covalent/core';
import { IComboOption } from './base';
@Component({
  selector: 'license-form',
  templateUrl: 'src/app/forms/license.form.html'
})
export class LicenseFormComponent implements AfterViewInit {
  form_title: string = 'Title';
  form_subtitle: string = '';
  data: any = {};
  isNew : boolean = true;
  constructor(private http: Http,
              private packs: LicensesService,
              private $L: LocaleService) {
      
  }
  private loadCombos(): void {
    /*
      this.http.get('organization')
        .map(response => response.json().map((org : any) => <IComboOption>{id: org.id, label: `(${org.code}) ${org.name}`}))
        .subscribe(
          data => this.organizations = (<IComboOption[]>data).sort((e1, e2) => e1.label.localeCompare(e2.label)),
          err => console.error('Error loading orgs')
        );
        */
  }
  log(obj: any) {
    console.log(obj)
  }
  
  ngOnInit(): void {
    this.loadCombos();
    this.data = {};
    this.form_title = this.$L.get('License data');
    this.form_subtitle = this.$L.get(this.isNew ? 'Create a new license': 'Modify the license data') ;
  }
  ngAfterViewInit(): void {
  }
}