angular 2 - 003 typescript

http://www.typescriptlang.org/docs/index.html

var book: string = "hellp angular 2";
var num: number = 123;

function lg (msg :string): void{
  console.log(msg)
}

类和接口

interface Shape{
  area(): number;
}

class Rectangle implements Shape{
  constructor(
      private width: number.
       private length: number
  ){}

//实现方法
  area(){
    return this.width  * this.length;
  }
}

装饰器


posted @ 2017-12-28 13:42  CooMark  阅读(162)  评论(0)    收藏  举报