I have been scratching my head on this particular test for hours. I believe that the demonstrated directive should be working, yet I am getting undefined for the value being passed to the isolate scope.
Code:
html
<!doctype html> <html ng-app="myApp"> <body> <a ng-href="#" class="test-scope" name="test">Console should say 'test' but gives undefined</a> </body> </html> javascript
angular.module('myApp', []) .directive('testScope', function() { return { restrict: 'C', scope: { name: "=" }, link: function(scope, element, attrs) { console.log(scope.name); } }; }); Here's the fiddle: http://jsfiddle.net/jPtb3/8/
Any help would be appreciated, I must be doing something wrong.