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
Copy file name to clipboardExpand all lines: README.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -569,7 +569,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
569
569
/* implementation details */
570
570
```
571
571
572
-
-Note: There are many naming options for directives, especially since they can be used in narrow or wide scopes. Choose one the makes the directive and it's file name distinct and clear. Some examples are below, but see the naming section for more recommendations.
572
+
-Note: There are many naming options for directives, especially since they can be used in narrow or wide scopes. Choose one the makes the directive and it's file name distinct and clear. Some examples are below, but see the naming section for more recommendations.
573
573
574
574
- **Limit DOM Manipulation**: When manipulating the DOM directly, use a directive. If alternative ways can be used such as using CSS to set styles or the [animation services](https://docs.angularjs.org/api/ngAnimate), Angular templating, [`ngShow`](https://docs.angularjs.org/api/ng/directive/ngShow) or [`ngHide`](https://docs.angularjs.org/api/ng/directive/ngHide), then use those instead. For example, if the directive simply hide and shows, use ngHide/ngShow, but if the directive does more, combining hide and show inside a directive may improve performance as it reduces watchers.
575
575
@@ -798,7 +798,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
798
798
799
799
*Why?*: [`ng-min`](https://github.com/btford/ngmin) is deprecated
800
800
801
-
- The following code is not using minification safe dependencies.
801
+
- The following code is not using minification safe dependencies.
802
802
803
803
```javascript
804
804
angular
@@ -818,7 +818,7 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
818
818
}
819
819
```
820
820
821
-
- When the above code is run through ng-annotate it will produces the following output with the `$inject` annotation and become minification-safe.
821
+
- When the above code is run through ng-annotate it will produces the following output with the `$inject` annotation and become minification-safe.
822
822
823
823
```javascript
824
824
angular
@@ -841,11 +841,10 @@ Many of my styles have been from the many pair programming sessions [Ward Bell](
841
841
842
842
```
843
843
844
-
- Note: If `ng-annotate` detects injection has already been made (e.g. `@ngInject` was detected), it will not duplicate the `$inject` code.
845
-
846
-
- Note: Starting from AngularJS 1.3 use the [`ngApp`](https://docs.angularjs.org/api/ng/directive/ngApp) directive's `ngStrictDi` parameter. When present the injector will be created in "strict-di" mode causing the application to fail to invoke functions which do not use explicit function annotation (these may not be minification safe). Debugging info will be logged to the console to help track down the offending code.
847
-
`<body ng-app="APP" ng-strict-di>`
844
+
- Note: If `ng-annotate` detects injection has already been made (e.g. `@ngInject` was detected), it will not duplicate the `$inject` code.
848
845
846
+
- Note: Starting from AngularJS 1.3 use the [`ngApp`](https://docs.angularjs.org/api/ng/directive/ngApp) directive's `ngStrictDi` parameter. When present the injector will be created in "strict-di" mode causing the application to fail to invoke functions which do not use explicit function annotation (these may not be minification safe). Debugging info will be logged to the console to help track down the offending code.
847
+
`<body ng-app="APP" ng-strict-di>`
849
848
850
849
- **Use Gulp or Grunt for ng-annotate**: Use [gulp-ng-annotate](https://www.npmjs.org/package/gulp-ng-annotate) or [grunt-ng-annotate](https://www.npmjs.org/package/grunt-ng-annotate) in an automated build task. Inject `/* @ngInject */` prior to any function that has dependencies.
0 commit comments