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

docs(ngController): Add in more description of controller as #7591

Closed
wants to merge 1 commit into from

Conversation

RichardLitt
Copy link
Contributor

Using controller as in the template is not described well
in the docs, as both scope injection and this are presented
equally without too much discussion of the advantages of using
either. I added a bit more discussion based on google's internal
style guidelines.

Should close #5076 until Angular 2.0 comes out and we refactor
everything.

Using `controller as` in the template is not described well
in the docs, as both `scope` injection and `this` are presented
equally without too much discussion of the advantages of using
either. I added a bit more discussion based on google's internal
style guidelines.

Should close angular#5076 until Angular 2.0 comes out and we refactor
everything.
@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7591)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

* easily be called from the angular markup. Any changes to the data are automatically reflected
* in the View without the need for a manual update.
*
* Two different declaration styles are included below: one which injects `scope` into the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "injects $scope", no?

petebacondarwin added a commit that referenced this pull request May 27, 2014
petebacondarwin pushed a commit that referenced this pull request May 27, 2014
Using `controller as` in the template is not described well
in the docs, as both `scope` injection and `this` are presented
equally without too much discussion of the advantages of using
either. I added a bit more discussion based on google's internal
style guidelines.

Closes #7591
Closes #5076 (until Angular 2.0 comes out and we refactor everything)
petebacondarwin added a commit that referenced this pull request May 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update all documentation examples to the 'controller as' syntax introduced in 1.5
3 participants