-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
When using the following setup
//Dashboard routes
.state('dashboard', {
abstract: true,
url: '/dashboard',
templateUrl: 'modules/dashboard/_layout.html'
})
.state('dashboard.overview', {
url: '/cases',
templateUrl: 'modules/dashboard/issue/issues.html',
controller: 'IssuesCtrl',
resolve: {
issues: function (Issues, $state)
{
console.log($state);
return Issues.query().$promise;
}
},
onEnter: function (issues, $state)
{
console.log(issues, $state);
if (issues.length === 1) {
$state.go('dashboard.issue', {id: issues[0].id})
}
}
})
I get the following 2 errors
TypeError: Cannot read property '@' of null
at updateView (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:3268:82)
at http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:3239:11
at Scope.$get.Scope.$broadcast (http://localhost:9000/bower_components/angular/angular.js:13790:50)
at Object.load (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:2999:22)
at Object.injectables.$template (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:2899:24)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4260:27)
at proceed (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:411:42)
at invoke (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:407:26)
at study (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:386:14)
at $Resolve.resolve (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:490:34) angular.js:10629
TypeError: Cannot read property '@dashboard' of null
at updateView (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:3268:82)
at http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:3239:11
at Scope.$get.Scope.$broadcast (http://localhost:9000/bower_components/angular/angular.js:13790:50)
at Object.load (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:2999:22)
at Object.injectables.$template (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:2899:24)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4260:27)
at proceed (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:411:42)
at invoke (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:407:26)
at study (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:386:14)
at $Resolve.resolve (http://localhost:9000/bower_components/angular-ui-router/release/angular-ui-router.js:490:34) angular.js:10629
when trying to enter the route with issue.length being 1.
When I use return Issues.query()
instead of return Issues.query().$promise
the issues are not resolved inside onEnter.
Metadata
Metadata
Assignees
Labels
No labels