
This requires delicate handling of type definitions which collide, because we use TypeScript-provided lib.d.ts for --target=es5 and lib.es6.d.ts for --target=es6. We need to include our polyfill typings only in the --target=es5 case, and the usages have to be consistent with lib.es6.d.ts. Also starting with this change we now typecheck additional modules, so this fixes a bunch of wrong typings which were never checked before. Fixes #3178
24 lines
642 B
TypeScript
24 lines
642 B
TypeScript
import {Component, View, NgFor} from 'angular2/angular2';
|
|
import {Jsonp, Response} from 'angular2/http';
|
|
import {ObservableWrapper} from 'angular2/src/facade/async';
|
|
|
|
@Component({selector: 'jsonp-app'})
|
|
@View({
|
|
directives: [NgFor],
|
|
template: `
|
|
<h1>people</h1>
|
|
<ul class="people">
|
|
<li *ng-for="#person of people">
|
|
hello, {{person['name']}}
|
|
</li>
|
|
</ul>
|
|
`
|
|
})
|
|
export class JsonpCmp {
|
|
people: Object;
|
|
constructor(jsonp: Jsonp) {
|
|
ObservableWrapper.subscribe<Response>(jsonp.get('./people.json?callback=JSONP_CALLBACK'),
|
|
res => this.people = res.json());
|
|
}
|
|
}
|