I have the following arrangement:
$stateProvider.state('home', {
url: '/',
template: ''
})
.state('profile', {
url: '/profile/view',
templateUrl: 'static/templates/profile.tpl.html'
})
.state('profile.view', {
url: '',
templateUrl: 'static/templates/profile-view.tpl.html',
controller: 'profileController',
controllerAs: 'pc'
})
.state('profile.edit', {
url: '/edit',
templateUrl: 'static/templates/profile-edit.tpl.html',
controller: 'editProfileController',
controllerAs: 'editCtrl'
})
;
What I intend to do is - I have some common partial content between the profile.view and the profile.edit states.
The common part is supposed inside the profile state. But the current arrangement is failing and /profile/view DOES NOT render any of the partials.
No errors reported to console.
Edit:
Here is profile.tpl.html
<div flex flex-gt-sm="50" flex-offset-gt-sm="25" layout="row" layout-align="center">
<div ui-view>
</div>
</div>
Edit 2:
After adding abstract: true the profile.view state started working fine. But profile.edit state keeps redirecting to /. Sort of following the .otherwise('/') rule
ui-viewdirective? It's required b/c the "view" and "edit" states are child states of "profile".ui-view, I've updated the question