I am having trouble with angularjs directives finding child DOM elements with the injected angular element.
For example I have a directive like so:
You can do it like this:
var myApp = angular.module('myApp', [])
.controller('Ctrl', ['$scope', function($scope) {
$scope.aaa = 3432
}])
.directive('test', function () {
return {
link: function (scope, elm, attr) {
var look = elm.children('#findme').addClass("addedclass");
console.log(look);
}
};
});
TEST Div
{{aaa}}
http://jsfiddle.net/FZGKA/133/