1 | "use strict";
|
2 | var lang_1 = require('../../facade/lang');
|
3 | var instruction_1 = require('../../instruction');
|
4 | var AsyncRouteHandler = (function () {
|
5 | function AsyncRouteHandler(_loader, data) {
|
6 | if (data === void 0) { data = null; }
|
7 | this._loader = _loader;
|
8 |
|
9 | this._resolvedComponent = null;
|
10 | this.data = lang_1.isPresent(data) ? new instruction_1.RouteData(data) : instruction_1.BLANK_ROUTE_DATA;
|
11 | }
|
12 | AsyncRouteHandler.prototype.resolveComponentType = function () {
|
13 | var _this = this;
|
14 | if (lang_1.isPresent(this._resolvedComponent)) {
|
15 | return this._resolvedComponent;
|
16 | }
|
17 | return this._resolvedComponent = this._loader().then(function (componentType) {
|
18 | _this.componentType = componentType;
|
19 | return componentType;
|
20 | });
|
21 | };
|
22 | return AsyncRouteHandler;
|
23 | }());
|
24 | exports.AsyncRouteHandler = AsyncRouteHandler;
|
25 |
|
\ | No newline at end of file |