We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
views: { viewName: Component }
1 parent faa9bcf commit 84aec02Copy full SHA for 84aec02
src/statebuilders/views.ts
@@ -1,5 +1,5 @@
1
/** @module ng2 */ /** */
2
-import {StateObject} from "@uirouter/core";
+import { isFunction, StateObject } from "@uirouter/core";
3
import {PathNode} from "@uirouter/core";
4
import {pick, forEach} from "@uirouter/core";
5
import {ViewConfig} from "@uirouter/core";
@@ -22,6 +22,7 @@ export function ng2ViewsBuilder(state: StateObject) {
22
23
forEach(viewsObject, function (config: Ng2ViewDeclaration, name: string) {
24
name = name || "$default"; // Account for views: { "": { template... } }
25
+ if (isFunction(config)) config = { component: config as any };
26
if (Object.keys(config).length == 0) return;
27
28
config.$type = "ng2";
0 commit comments