[FE] Angular 1 legacy: How to obtain the binding 'controller' from the element ?

in #coding8 years ago

We can use angular.element($0).controller('someDirective') to accomplish this, refer to the API: https://docs.angularjs.org/api/ng/function/angular.element.

The angular.element($0) will expose the wrapped object by angular on the element, you can also get the "scope" or "isolateScope" of the element.

Sort:  

Congratulations @huming0618! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

Carnival Challenge - Here are the winners
Vote for @Steemitboard as a witness to get one more award and increased upvotes!