Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .state('app.contactsTest', {
- abstract: true, <<--- If set to true then I get redirected away from the state to the default. If unset then named views don't load
- url: '/contactstest',
- templateUrl: 'tpl/app.contactsTest.html',
- controller: 'ContactTestCtrl',
- controllerAs: 'vm',
- resolve: {
- groups: function () { return {} },
- contacts: function () { return {} },
- contact: function () { return {} }
- }
- })
- .state('app.contactsTest.subViews', {
- views: {
- 'groups': {
- templateUrl: 'tpl/app.contacts.groups.html'
- controller: 'ContactGroupCtrl',
- controllerAs: 'groupCtrl',
- resolve: {
- groups: [ 'ContactGroupSvc', function (ContactGroupSvc) {
- ContactGroupSvc.list().success(function (res) {
- return res;
- });
- }]
- }
- },
- 'contacts': {
- templateUrl: 'app.contacts.list.html'
- resolve: {
- contacts: [ 'ContactSvc', function (ContactSvc) {
- ContactSvc.list().success(function (res) {
- return res;
- });
- }]
- }
- },
- 'view': {
- url: '/{id}',
- templateUrl: 'app.contacts.view.html'
- resolve: {
- contact: [ 'ContactSvc', '$stateParams', function (ContactSvc, $stateParams) {
- ContactSvc.get($stateParams.id).success(function (res) {
- res.selected = true;
- return res;
- });
- }]
- }
- },
- 'edit': {
- url: '/edit/{id}',
- templateUrl: 'app.contacts.edit.html'
- resolve: {
- contact: [ 'ContactSvc', '$stateParams', function (ContactSvc, $stateParams) {
- ContactSvc.get($stateParams.id).success(function (res) {
- res.selected = true;
- res.editing = true;
- return res;
- });
- }]
- }
- }
- }
- }
- tpl/app.contactsTest.html
- <!-- hbox layout -->
- <div class="hbox hbox-auto-xs hbox-auto-sm bg-light ">
- <!-- column -->
- <div class="col w-sm b-r" ui-view="groups"></div>
- <!-- /column -->
- <!-- column -->
- <div class="col w lter b-r" ui-view="contacts"></div>
- <!-- /column -->
- <!-- column -->
- <div class="col bg-white-only" ui-view="view"></div>
- <!-- /column -->
- <!-- column -->
- <div class="col bg-white-only" ui-view="edit"></div>
- <!-- /column -->
- </div>
- <!-- /hbox layout -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement