这是我的HTML。 genericsearch
是一个指令:
<genericsearch search-text="organisationSearchEvent"></genericsearch>
我试图打电话给organisationSearchEvent
但是没有被叫。我该如何解决这个问题?
我的指示:
.directive('genericsearch', [function () {
return {
restrict: 'E',
replace: true,
scope: {
objectType : '=',
searchText: '=',
},
link:function(scope,elem,attrs) {
scope.myParam = 'tei_org';
},
controller: [
'$scope',
'$element',
'$rootScope',
'SearchOrg',
'MapOrgs',
'$routeParams',
'DelOrgs',
'GetTemplateGroups',
'FetchOrgs',
function($scope,$element,$rootScope,SearchOrg,MapOrgs,$routeParams,DelOrgs,GetTemplateGroups,FetchOrgs){
$scope.organisationSearchEvent= function(organisationSearchEvent,filter) {
console.log('orglist'+JSON.stringify($scope.myParam));
console.warn('text'+JSON.stringify($scope.text));
SearchOrg().fetch({'filter':filter, 'searchType':'tei_org'}).$promise.then(
function(value){
$scope.orgList = value.data;
},
function(err){
});
});
$scope.getOrgs = function(data, event) {
if(event.keyCode != 13){
//$scope.Participants(data);
$scope.organisationSearchEvent(data);
}
}
// console.log('orglist'+JSON.stringify($scope.orgList));
}
],
templateUrl : TAPPLENT_CONFIG.HTML_ENDPOINT[0]+'home/search.html'
}}])