Veikedo

Untitled

May 24th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {DictionaryService} from "DataAccess/Dictionary/DictionaryService";
  2. import {BaseSelector, emptyTemplate} from "./BaseQueryableSelector";
  3. import {Inject, Component} from "Utils/Component";
  4.  
  5. export class BaseDictionarySelector extends BaseSelector {
  6.     constructor(params, private _promise: Promise<any[]>) {
  7.         super(params);
  8.     }
  9.  
  10.     init(initValue) {
  11.         this._promise.then(items => {
  12.             this.items(items);
  13.             this.value(initValue);
  14.         });
  15.     }
  16. }
  17.  
  18. @Component({
  19.     selector: "skill-selector",
  20.     template: emptyTemplate,
  21.     providers: [DictionaryService]
  22. })
  23. export class SkillSelector extends BaseDictionarySelector {
  24.     constructor(@Inject("params") params, dictionaryService: DictionaryService) {
  25.         super(params, dictionaryService.getSkills());
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment