Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Docs should be consistent with respect to guidance on use of ng-init #10489

Closed
fredsa opened this issue Dec 16, 2014 · 0 comments
Closed

Docs should be consistent with respect to guidance on use of ng-init #10489

fredsa opened this issue Dec 16, 2014 · 0 comments

Comments

@fredsa
Copy link
Contributor

fredsa commented Dec 16, 2014

The ng-init docs state:

The only appropriate use of ngInit is for aliasing special properties of
{@link ng.directive:ngRepeat ngRepeat}, as seen in the demo below. Besides this case, you
should use {@link guide/controller controllers} rather than ngInit
to initialize values on a scope.

However, some of the docs' own examples (e.g. ng-mousenter) explicitly use ng-init in a way which violates the above guidance.

For example, ng-mouseenter contains this example:

   <example>
     <file name="index.html">
      <button ng-mouseenter="count = count + 1" ng-init="count=0">
        Increment (when mouse enters)
      </button>
      count: {{count}}
     </file>
   </example>
@pkozlowski-opensource pkozlowski-opensource added this to the Backlog milestone Dec 17, 2014
@Narretz Narretz self-assigned this Oct 5, 2017
Narretz added a commit to Narretz/angular.js that referenced this issue Oct 9, 2017
Narretz added a commit to Narretz/angular.js that referenced this issue Oct 9, 2017
Narretz added a commit to Narretz/angular.js that referenced this issue Oct 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants