I have a problem - I forgot how to encode! I have an angularJS directive that is on the parent wrapper (DIV) tag, and in my directive I want to scroll the children (the first children of the DIV). I have the following
<div data-check-attributes> <div data-ng-repeat="user in Users" data-id="{{ user.ID }}" data-ng-click="doSomething(user.ID)" data-new="{{ user.newUser }}" class=""> <div> {{ user.userName }} </div> <div> {{ user.userAge }} </div> </div> </div>
Now, in my directive, I want to skip the first child divs (there may be many, but I see 10 users in the loaded view) and perform certain checks and modifications in my directive using data attributes, the $ location object, and possibly many more .. However, I canβt remember how to iterate over the first child divs, I seem to get errors with everything I tried ... as long as I have it, that doesn't work! In the example below, I just want to write the data id of the first child nodes to the console
.directive('checkAttributes', function ($location) { return{ restrict: 'A', link: function (scope, element) {
I'm confused ... help!
javascript angularjs
Mark sandman
source share