Fix addressbook directive
This commit is contained in:
parent
6b571e64ec
commit
32a9c208b7
1 changed files with 6 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue