refactor(examples): ts’ify

relates to #2008
This commit is contained in:
Victor Berchet
2015-05-22 14:39:00 +02:00
parent 4b98ed114e
commit 6c1cb089b5
14 changed files with 163 additions and 281 deletions

View File

@ -1,24 +0,0 @@
import { BaseException, print, CONST } from 'angular2/src/facade/lang';
import { bootstrap } from 'angular2/angular2';
// TODO(radokirov): Once the application is transpiled by TS instead of Traceur,
// add those imports back into 'angular2/angular2';
import {Component} from 'angular2/src/core/annotations_impl/annotations';
import {View} from 'angular2/src/core/annotations_impl/view';
@Component({
selector: 'error-app',
})
@View({
template: `
<button class="errorButton" (click)="createError()">create error</button>`,
directives: []
})
export class ErrorComponent {
createError() {
throw new BaseException('Sourcemap test');
}
}
export function main() {
bootstrap(ErrorComponent);
}

View File

@ -0,0 +1,17 @@
import {BaseException} from 'angular2/src/facade/lang';
import {bootstrap, Component, View} from 'angular2/angular2';
@Component({
selector: 'error-app',
})
@View({
template: `
<button class="errorButton" (click)="createError()">create error</button>`
})
export class ErrorComponent {
createError(): void { throw new BaseException('Sourcemap test'); }
}
export function main() {
bootstrap(ErrorComponent);
}