Hi Mo,
Ah, now I get your problem. You need to attach your 'click' in the next
digest cycle. When the data comes in, it isn't rendered to the view
directly, but rather checked and handled by angular, and then added to the
view. This means that when you do a $(xxx).yyy on the next line, the dom
isn't there yet. So you need to make sure your code happens in the next
cycle. do something like this:
$http.get('engineers/all').success(function(data) { // let's load some data
$scope.engineers = engineers; // ok, we get Data let's render them on
page, $scope.engineers is bound to template
$timeout(function () {
$('#bugsTable a:first').click(); // now I need to click on created
link, I expected that link was created on line above, but it wasn't. So
what is the right way to make "click" in this case?
},0);
});
Don't forget to inject $timeout in the containing function.
Does that help you a bit?
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.