UNPKG

982 BJavaScriptView Raw
1"use strict";
2var lang_1 = require('../../facade/lang');
3var instruction_1 = require('../../instruction');
4var AsyncRouteHandler = (function () {
5 function AsyncRouteHandler(_loader, data) {
6 if (data === void 0) { data = null; }
7 this._loader = _loader;
8 /** @internal */
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}());
24exports.AsyncRouteHandler = AsyncRouteHandler;
25//# sourceMappingURL=async_route_handler.js.map
\No newline at end of file