If you find yourself using
$('element') in your controllers or services, best practices dictate that you move that code to a directive. This is usually because, whenever you use
$('element'), the next code fragment that follows is one that manipulates DOM in one form or another.
Share this highlighthttp://www.safaribooksonline.com/a/angularjs-services/51501/