Skip to content

Commit 7988c12

Browse files
committed
Update the directives section
1 parent c9d1c1e commit 7988c12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ With `div#child` is associated `ChildCtrl` but since the scope injected inside `
146146

147147
### Directives
148148

149-
In AngularJS the directives are the place where all DOM manipulations should be encapsulated. Each directive has a name and logic associated with it. In the simplest case the directive contains only name and definition of *postLink* function, which encapsulates all the logic required for the directive. In more complex cases the directive could contain a lot of properties such as:
149+
In AngularJS the directives are the place where all DOM manipulations should be placed. As a rule of thumb, when you have DOM manipulations in your controller you should create a new direcrive or consider refactoring of already existing one, which could handle the required DOM manipulations.
150+
Each directive has a name and logic associated with it. In the simplest case the directive contains only name and definition of *postLink* function, which encapsulates all the logic required for the directive. In more complex cases the directive could contain a lot of properties such as:
150151

151152
- template
152153
- compile function

0 commit comments

Comments
 (0)