I am trying to get UI router to have a detailed message view, here is the code:
.state('app.messages.detail', {
url: 'messages/{id}',
templateUrl: 'templates/views/message.html',
controller: function($scope, sharedProperties, $stateParams) {
console.log($stateParams);
messages = sharedProperties.getMessages();
$scope.message = messsages.name[$stateParams.id];
}
})
Here is the messages array:
var messages = {
"Deputy":
{
"name": "Deputy",
"message": ["Test", "Whey", "I See you!"]
},
"SOCO":
{
"name": "SOCO",
"message": ["Second Test", "Does this actually work?"]
}
};
However when I go to /#/messages/Deputy
I get redirected to /
(There's a redirect to say to go to /
if page not found)