creating custom angularJs directive to make modular code -


I'm new to AngularJs. I'm a div section related to div elements and some jquery code I'm part of this code. I am planning to build and make custom instructions. Is it a nice design that gives angular such flexibility to include pure jquery code inside the angular director?

See controller is smelly

instructions for implementing jquery code for elements Using the best method, this argument should probably be different from the controller for the implementation of many elements of the instructions.

If you need to communicate with the instructions to see the controller, then something is smelly (callback is allowed)

And jQuery is a global variable, so yes you You can use jquery in the instructions.

link and controller functions $ element parameter, which is a reference to html element, applies to this instruction It's already $ element variable is already wrapped with jquery. You can do $ element.attr ("...") or something.


Comments