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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -