(fix) Resolve addressbook before rendering view

pull/91/head
Francis Lachapelle 2015-07-20 15:32:57 -04:00
parent cdd449fec9
commit dfb750caf4
2 changed files with 3 additions and 5 deletions

View File

@ -117,7 +117,7 @@
*/
stateAddressbook.$inject = ['$stateParams', 'AddressBook'];
function stateAddressbook($stateParams, AddressBook) {
return AddressBook.$find($stateParams.addressbookId);
return AddressBook.$find($stateParams.addressbookId).$futureAddressBookData;
}
/**

View File

@ -420,10 +420,8 @@
AddressBook.prototype.$unwrap = function(futureAddressBookData) {
var _this = this;
// Expose the promise
this.$futureAddressBookData = futureAddressBookData;
// Resolve the promise
this.$futureAddressBookData.then(function(data) {
// Expose and sesolve the promise
this.$futureAddressBookData = futureAddressBookData.then(function(data) {
return AddressBook.$timeout(function() {
// Extend AddressBook instance from data of addressbooks list.
// Will inherit attributes such as isEditable and isRemote.