forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxhr_impl.ts
More file actions
16 lines (14 loc) · 698 Bytes
/
xhr_impl.ts
File metadata and controls
16 lines (14 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import {Injectable} from 'angular2/src/core/di';
import {PRIMITIVE} from 'angular2/src/web_workers/shared/serializer';
import {XHR_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
import {XHR} from 'angular2/src/core/render/xhr';
import {ServiceMessageBrokerFactory} from 'angular2/src/web_workers/shared/service_message_broker';
import {bind} from './bind';
@Injectable()
export class MessageBasedXHRImpl {
constructor(private _brokerFactory: ServiceMessageBrokerFactory, private _xhr: XHR) {}
start(): void {
var broker = this._brokerFactory.createMessageBroker(XHR_CHANNEL);
broker.registerMethod("get", [PRIMITIVE], bind(this._xhr.get, this._xhr), PRIMITIVE);
}
}