sandeep
sandeep

Reputation: 2882

How to external js method in Angularjs controller

Hi I have a jQuery defined method named "Mymethod()" in widjets.js which needs to be called in AngularJs Controller written in Typescript.

Upvotes: 0

Views: 47

Answers (1)

basarat
basarat

Reputation: 276057

I have a jQuery defined method named "Mymethod()" in widjets.js which needs to be called in AngularJs Controller written in Typescript.

The jQuery method will most likely need access to the DOM element. Therefore instead of doing this in a controller you should wrap in an angular directive.

Docs : https://docs.angularjs.org/guide/directive

Upvotes: 2

Related Questions