4 ms·
> When starting out, forgo writing directives. You need a deep knowledge of AngularJS' internals to debug directives when they misbehave. Instead, start by writ
by j_baker 13y ago
> When starting out, forgo writing directives. You need a deep knowledge of AngularJS' internals to debug directives when they misbehave. Instead, start by writing a small controller and view. You can refactor these into a directive later when it feels right.
No. Controllers should not be used for DOM manipulation. Angular directives take some learning, but they're great. It basically turns DOM node selection into a matter of Dependency Injection. I think it's an exaggeration to say that directives require "deep knowledge of AngularJS' (sic) internals".
- vedant 13y agoWhy the "(sic)"? Is "AngularJS" not the preferred stylization?
- mattwad 13y agonot sure if it's what he meant, but the correct possessive should be AngularJS's
- acconrad 13y agoExactly, and this is echoed by the Angular development team (http://docs.angularjs.org/guide/controller http://docs.angularjs.org/guide/controller).