Aviel Fedida Aviel Fedida - 1 year ago 246
Javascript Question

Angularjs: Get element in controller

I am new to angularjs, I know that

represent a connection between the controller and the view, But is there a way besides looking for
to get the scope element, I mean something like that:

function someControllerFunc($scope){

I know that same controller can be assigned to multiple scopes, So maybe it is not possible, If anyone know a way to do it i will be very thankful, Thank you all and have a nice day.

Answer Source

You can pass in the element to the controller, just like the scope:

function someControllerFunc($scope, $element){

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download