app-decorators
Version:
Collection of useful ES7 Decorators, writtin in ES6, that can be used for building webapps
59 lines (47 loc) • 1.66 kB
JavaScript
System.register(['app-decorators/src/libs/element-to-function', '../libs/eventhandler', '../libs/router', '../libs/dependencies', '../configs/route.config.client'], function (_export, _context) {
"use strict";
var _elementToFunc, Eventhandler, Router, extend, routerConfig;
return {
setters: [function (_appDecoratorsSrcLibsElementToFunction) {
_elementToFunc = _appDecoratorsSrcLibsElementToFunction.default;
}, function (_libsEventhandler) {
Eventhandler = _libsEventhandler.Eventhandler;
}, function (_libsRouter) {
Router = _libsRouter.Router;
}, function (_libsDependencies) {
extend = _libsDependencies.extend;
}, function (_configsRouteConfigClient) {
routerConfig = _configsRouteConfigClient.routerConfig;
}],
execute: function () {
/**
* create
* @param {Object} config
* @return {Router} router
*/
Router.create = function () {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _routerConfig = Router.makeConfig(config);
return new Router(_routerConfig);
};
/**
* makeConfig
* @param config
* @return {object} _routerConfig
*/
Router.makeConfig = function () {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _routerConfig = extend(true, {}, routerConfig, config);
_routerConfig.scope = new Eventhandler({
element: _routerConfig.scope
});
_routerConfig.globalScope = new Eventhandler({
element: _routerConfig.globalScope
});
return _routerConfig;
};
_export('Router', Router);
}
};
});
//# sourceMappingURL=router.js.map