When you create a directive with an isolated scope, no template within the directive, but there is some dom elements inside the directive, those dom elements cannot bind to the scope of the directive.
<div ng-controller="testCtrl">
{{hehe}}
<hr/>
<div test-directive="hello" >
Directive Data:
<div>{{test}}</div>
</div>
</div>
angular.module('app',[])
.controller("testCtrl",['$scope', function ($scope) {
$scope.hehe = "test from controller";
}])
.directive("testDirective",function(){
return{
scope: {
"testDirective": "="
},
controller: ['$scope', function ($scope) {
$scope.test = "test from directive";
}]
};
});
In the demonstration, there are two versions of the Angular library used, 1.1.5 and 1.2.4, and one of them is commented out.
The code functions correctly with version 1.1.5 but not with 1.2.4.
Could someone clarify what is causing this issue?