Replaces directive by an object of addressbook on walletDetails

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-21 11:58:33 -03:00
commit 53977ac00e
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
3 changed files with 22 additions and 27 deletions

View file

@ -113,13 +113,10 @@ angular.module('copayApp.directives')
}
}
})
.directive('contact', ['addressbookService', 'lodash', 'gettextCatalog',
function(addressbookService, lodash, gettextCatalog) {
.directive('contact', ['addressbookService', 'lodash',
function(addressbookService, lodash) {
return {
restrict: 'E',
scope: {
label: '='
},
link: function(scope, element, attrs) {
var addr = attrs.address;
addressbookService.get(addr, function(err, ab) {
@ -127,11 +124,7 @@ angular.module('copayApp.directives')
var name = lodash.isObject(ab) ? ab.name : ab;
element.append(name);
} else {
if (scope.label && scope.label == 'Sent') {
element.append(gettextCatalog.getString('Sent'));
} else {
element.append(addr);
}
element.append(addr);
}
});
}