Fix addressbook directive

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-13 11:12:18 -03:00
commit 32a9c208b7
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -113,15 +113,16 @@ angular.module('copayApp.directives')
}
}
})
.directive('contact', ['addressbookService',
function(addressbookService) {
.directive('contact', ['addressbookService', 'lodash',
function(addressbookService, lodash) {
return {
restrict: 'E',
link: function(scope, element, attrs) {
var addr = attrs.address;
addressbookService.getLabel(addr, function(label) {
if (label) {
element.append(label);
addressbookService.get(addr, function(err, ab) {
if (ab) {
var name = lodash.isObject(ab) ? ab.name : ab;
element.append(name);
} else {
element.append(addr);
}