In the javascript file, the code is like this:
angular.module("amodule")
.directive("bdirective",function(){
return{
scope: {
testIsolated: '&test',
},
restrict:'EA',
replace: true,
templateUrl: "address.html",
}
.controller{"ccontroller",function($scope){
$scope.test=function(){
w="changed"
return w;
};
};
In the index.html file, the code is like this:
<bdirective testIsolated="test()"></bdirective>
...
In the address.html file, the code is like this:
<button ng-click="result=testIsolated()">Button1</button>
...
I think when the Button1 is clicked, testIsolated should run, and then test() should run. The value of "result" should be changed to "changed".
But it doesn't work
Can anyone help me figure it out?
Thanks in advance