Closed
Description
I have the following $stateProvider configuration, in which I use an abstract state main.profile
resolving a resource that its child states (e.g. main.profile.view
) inherit and use. I've noticed that, when running Jasmine unit tests on Karma, due to the fact the url: ''
on main.profile.view
state, I see a series of 404 warnings, as copied below:
.state('main.profile', {
abstract: true,
url: '/:username',
resolve: {
usersResource: 'Users',
user: function(usersResource, $stateParams){
var username = $stateParams.username;
return usersResource.get({username: username}).$promise;
}
},
controller: 'ProfileViewCtrl',
templateUrl: 'public/modules/pro/views/profileContainer.client.view.html'
})
.state('main.profile.view', {
url: '',
templateUrl: 'public/modules/pro/views/view.client.view.html',
onEnter: function(user){
this.title = user.displayName;
}
})
.state('main.profile.work', {
url: '/work',
templateUrl: 'public/modules/pro/views/portfolio.client.view.html',
onEnter: function(user) {
this.title = 'Porfólio de ' + user.displayName;
}
})
404 warnings:
WARN [web-server]: 404: /public/modules/main/views/container.client.view.html
WARN [web-server]: 404: /public/modules/pro/views/profileContainer.client.view.html
WARN [web-server]: 404: /public/modules/pro/views/view.client.view.html
WARN [web-server]: 404: /users/context.html
WARN [web-server]: 404: /public/modules/core/views/404.client.view.html
WARN [web-server]: 404: /public/modules/core/views/404.client.view.html
WARN [web-server]: 404: /public/modules/core/views/404.client.view.html
The last three 404 warnings are due to an 404 interceptor configured on $httpProvider
.
Did anybody have a similar problem and managed to solve?
Metadata
Metadata
Assignees
Labels
No labels