uikolas

types

Jan 12th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Gali taip, bet cia su private tiesiog iškvietus constructorių
  2. class Test {
  3.   constructor(setup: string) {
  4.     this.Create(setup);
  5.   }
  6.  
  7.   private Create(setup):void {
  8.     // kažka padarom
  9.   }
  10.  
  11. }
  12.  
  13. // Gali ir taip su public
  14. interface ITest {
  15.   Create(setup?: string): void;
  16. }
  17.  
  18. class Test {
  19.   private setup:
  20.   constructor(setup: string) {
  21.     this.SetSetup(setup);
  22.   }
  23.  
  24.   private SetSetup(setup: string) {
  25.     this.setup = setup;
  26.   }
  27.  
  28.   public Create(setup: string = null):void {
  29.     if(setup != null) {
  30.       this.setup = setup;
  31.     }
  32.    
  33.     // kažka padarom su this.setup
  34.   }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment