angularjs - Angular ng-init pass element to scope -
is there way current element ng-init binded on?
for example:
<div ng-init="dosomething($element)"></div>
i believe there way ng-click can't using ng-init this:
<div ng-click="dosomething($event)"></div>
controller:
$scope.dosomething = function(e){ var element = angular.element(e.srcelement); }
how do ng-init?
don't it.
as @codehater said, handling dom manipulation in directive better solution engaging controller element.
Comments
Post a Comment