-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
In main.ts:28, the code attempts to get the state.component.selector property, which doesn't (any longer?) exist. I worked around this by doing the following, but it sure would be nice if the workaround wasn't needed. (And save people a LOT of hours!)
import "reflect-metadata";
...
export interface IComponentState extends ng.ui.IState {
componentClass: any;
}
...
const routes: IComponentState[] = [
{ name: "home", url: "/", componentClass: RootComponent }
];
...
private static provideStates(states: IComponentState[], $stateProvider: ng.ui.IStateProvider) {
states.map((config) => {
// Set component name by reflecting metadata from component's @Component decorator
const componentName = Reflect.getMetadata("custom:name", config.componentClass);
config.component = componentName;
delete config.componentClass;
return { name: config.name, config };
}).forEach(state => $stateProvider.state(state.name, state.config));
}Metadata
Metadata
Assignees
Labels
No labels