You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
161
-
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:
By citing the name of the directives they can be used inside the declarative partials.
168
+
ディレクティブの名前を利用することで、パーシャルの中で利用することができます。
169
169
170
-
Example:
170
+
例:
171
171
172
172
```JavaScript
173
173
myModule.directive('alertButton', function () {
@@ -192,9 +192,9 @@ myModule.directive('alertButton', function () {
192
192
<alert-buttoncontent="42">Click me</alert-button>
193
193
```
194
194
195
-
In the example above the tag `<alert-button></alert-button>`will be replaced button element. When the user clicks on the button the string `42`will be alerted.
0 commit comments