On the Angular app home page, I have a view and a subview (see ui-router code below). For presentation, I call a call $httpto my database and outputting the results with ng-repeat. At the same time, I push these results to the service. In the nested view, I call one result from the service and display it (I use two controllers). My problem is that I need all this to happen on boot. Is the “solution” in u-router the best way to get closer to this?
$urlRouterProvider.otherwise('/open');
$urlRouterProvider.when('/open', '/open/mainbook');
$stateProvider
.state('open', {
url: '/open',
templateUrl: 'ang/views/open.html',
})
.state('open.mainbook', {
url: '/{featId}',
templateUrl: 'ang/views/open.mainBook.html',
})`
source
share