chore: disable dart for HTTP package
BREAKING CHANGE Stop supporting http module in Dart. This is because Dart has a well developed http package which should be used by Dart customers instead.
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
library examples.src.jsonp.jsonp_comp;
|
||||
|
||||
import "package:angular2/angular2.dart" show Component, View, NgFor;
|
||||
import "package:http/http.dart" show Jsonp;
|
||||
import "package:angular2/src/facade/async.dart" show ObservableWrapper;
|
||||
|
||||
@Component(selector: "jsonp-app")
|
||||
@View(
|
||||
directives: const [NgFor],
|
||||
template: '''
|
||||
<h1>people</h1>
|
||||
<ul class="people">
|
||||
<li *ng-for="#person of people">
|
||||
hello, {{person[\'name\']}}
|
||||
</li>
|
||||
</ul>
|
||||
''')
|
||||
class JsonpCmp {
|
||||
Object people;
|
||||
JsonpCmp(Jsonp jsonp) {
|
||||
ObservableWrapper.subscribe(
|
||||
jsonp.get("./people.json?callback=JSONP_CALLBACK"),
|
||||
(res) => this.people = res.json().toList());
|
||||
}
|
||||
}
|
2116
modules/examples/src/routing/data.ts
Normal file
2116
modules/examples/src/routing/data.ts
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@ import {
|
||||
Location,
|
||||
RouteParams
|
||||
} from 'angular2/router';
|
||||
import {Http, Response} from 'http/http';
|
||||
import * as db from './data';
|
||||
import {ObservableWrapper, PromiseWrapper} from 'angular2/src/facade/async';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {isPresent} from 'angular2/src/facade/lang';
|
||||
@ -59,12 +59,9 @@ class InboxRecord {
|
||||
|
||||
@Injectable()
|
||||
class DbService {
|
||||
constructor(public http: Http) {}
|
||||
|
||||
getData() {
|
||||
var p = PromiseWrapper.completer();
|
||||
ObservableWrapper.subscribe<Response>(this.http.get('./db.json'),
|
||||
(resp) => { p.resolve(resp.json()); });
|
||||
p.resolve(db.data);
|
||||
return p.promise;
|
||||
}
|
||||
|
||||
|
@ -2,14 +2,11 @@ import {InboxApp} from './inbox-app';
|
||||
import {bind} from 'angular2/angular2';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {routerInjectables, HashLocationStrategy, LocationStrategy} from 'angular2/router';
|
||||
import {HTTP_BINDINGS} from 'http/http';
|
||||
|
||||
import {reflector} from 'angular2/src/reflection/reflection';
|
||||
import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
|
||||
|
||||
export function main() {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
bootstrap(
|
||||
InboxApp,
|
||||
[routerInjectables, HTTP_BINDINGS, bind(LocationStrategy).toClass(HashLocationStrategy)]);
|
||||
bootstrap(InboxApp, [routerInjectables, bind(LocationStrategy).toClass(HashLocationStrategy)]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user