- By 汤桂川
Speaker/Writer/Globetrotter
-- Front End Expert @Ant Financial
-- Ex @ GF.S && @Tencent
旅行Tips
泡泡林屋
感受大自然
泡泡林屋 内部
国际自驾游 - 右舵
常旅客计划 - 积分
SPEED (change detection、view cache、init)
CROSS PLATFORM (worker、server、native)
Mobile (Android 4.1、 iOS 7.1、IE9+)
Flexible (TypeScript/ES6、 ES5、Dart)
AOT (静态编译)、Tree-shaking (<50k)
interface ClockInterface {
currentTime: Date;
color?: string;
}
class Clock implements ClockInterface {
private name: string;
currentTime: Date;
static origin = {x: 0, y: 0};
constructor(h: number, m: number) {}
}
@SomeDecorator
class Test {}
// The same as
class Test {}
Test = SomeDecorator(Test) || Test;
function someDecorator(target) {
// Do something with target function
target.isTestable = true;
}
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>Hello World</h1>'
})
export class AppComponent { }
import { NgModule } from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
Github:
lightningtgc/awesome-ng2
《揭秘 Angular 2》
Angular 2 调查问卷示例项目
<thank-you [date]="'2017.03'">
</thank-you>