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