0
.directive('optionFoundAddressClickableDisplay', function(search,$state,Service,$log) {
'use strict';
return {
replace: true,
restrict: 'AE',
template: '<ul class="dropdown-menu apartment-group" ng-show="barClickable"><li><a href ng-click="searchMatch()"><span class="gr-arrow pull-right"></span>' +
'<div class="result-text ng-binding"><img src="images/map-pin.png" class="map-pin" alt=""/>{{ buildingName }}</div> </a>' +
'</li></ul>',
link: function(scope, element, attrs) {
scope.buildingName = search.result.buildingAddress;
scope.barClickable = (search.result.matchedNua || search.result.matchedId !== null) ? true : false;
scope.searchMatch = function(){
$log.warn("gets here");
};
}
};
})
似乎无法在我的指令中点击ng-click-searchMatch()。我需要以不同的方式在指令中声明一个函数吗?指令内的角度调用函数
在控制台中的任何错误? – 2015-04-01 08:48:26