From 2edfd1863b8ab1ca456bb99be6a147fa2694ba0d Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 20 Mar 2015 13:30:46 -0400 Subject: [PATCH] Addressbook module: improve routing views handling --- UI/WebServerResources/js/ContactsUI.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/UI/WebServerResources/js/ContactsUI.js b/UI/WebServerResources/js/ContactsUI.js index b63cbcc55..a444bd3e5 100644 --- a/UI/WebServerResources/js/ContactsUI.js +++ b/UI/WebServerResources/js/ContactsUI.js @@ -59,8 +59,7 @@ abstract: true, views: { card: { - template: '', - controller: 'CardCtrl' + template: '' } }, resolve: { @@ -71,13 +70,21 @@ }) .state('addressbook.card.view', { url: '/view', - templateUrl: 'UIxContactViewTemplate', // UI/Templates/Contacts/UIxContactViewTemplate.wox - controller: 'CardCtrl' + views: { + 'card@addressbook': { + templateUrl: 'UIxContactViewTemplate', // UI/Templates/Contacts/UIxContactViewTemplate.wox + controller: 'CardCtrl' + } + } }) .state('addressbook.card.editor', { url: '/edit', - templateUrl: 'UIxContactEditorTemplate', // UI/Templates/Contacts/UIxContactEditorTemplate.wox - controller: 'CardCtrl' + views: { + 'card@addressbook': { + templateUrl: 'UIxContactEditorTemplate', // UI/Templates/Contacts/UIxContactEditorTemplate.wox + controller: 'CardCtrl' + } + } }); // if none of the above states are matched, use this as the fallback