Watch field item changes

To allow fields in hz-resource-property-list to be refreshed upon
action.

Change-Id: I8f2dffad0fb28bd5b8d0a019ed28268fb8cbcd60
Closes-Bug: #1616251
This commit is contained in:
Jacky Hu 2018-04-15 19:44:59 +08:00
parent eea762663b
commit d175d33037
1 changed files with 7 additions and 1 deletions

View File

@ -107,6 +107,12 @@
///////////////////
function link(scope, element) {
scope.$watch('item', function() {
filterItem(scope, element);
});
}
function filterItem(scope, element) {
var config = scope.config;
var item = scope.item;
var propValue = item[config.id];
@ -131,7 +137,7 @@
}
if (url) {
element.append(angular.element('<a>').attr('href', url).text(output));
element.replaceWith(angular.element('<a>').attr('href', url).text(output));
} else {
element.text(output);
}