Closed jh97uk closed 10 years ago
Considering that this is a syntax error, I doubt very much this is something in the framework. It must be giving you a location of where this happens?
Oh god, sorry. Completely left out where the error occurs... Line 29 where its pages[state].view: {
app.config(function($locationProvider, $routeProvider, $stateProvider){
$routeProvider.otherwise({redirectTo:"/home"});
for(state in pages){
$stateProvider.state(pages[state].name, {
route:pages[state].path,
views: { //This is invalid JavaScript... Just like it tells you, it expects pages to be a property, which is why it expects a : over a [... hence the syntax error.
pages[state].view: {
template: pages[state].page
}
}
});
}
});
Im trying to make it so I have an array of predefined states which also define which view changes which. This is what I have so far:
Just throws the error:
Uncaught SyntaxError: Unexpected token [
Appologies if this is not a bug, just cant see why this wouldn't work.