Merge pull request #101 from cmgustavo/ref/design-27
Fix addressbook directive
This commit is contained in:
commit
9b440078f3
1 changed files with 6 additions and 5 deletions
|
|
@ -113,15 +113,16 @@ angular.module('copayApp.directives')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.directive('contact', ['addressbookService',
|
.directive('contact', ['addressbookService', 'lodash',
|
||||||
function(addressbookService) {
|
function(addressbookService, lodash) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
var addr = attrs.address;
|
var addr = attrs.address;
|
||||||
addressbookService.getLabel(addr, function(label) {
|
addressbookService.get(addr, function(err, ab) {
|
||||||
if (label) {
|
if (ab) {
|
||||||
element.append(label);
|
var name = lodash.isObject(ab) ? ab.name : ab;
|
||||||
|
element.append(name);
|
||||||
} else {
|
} else {
|
||||||
element.append(addr);
|
element.append(addr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue