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

Update concepts.ngdoc #6639

Closed
wants to merge 1 commit into from
Closed

Update concepts.ngdoc #6639

wants to merge 1 commit into from

Conversation

IamAnn
Copy link

@IamAnn IamAnn commented Mar 11, 2014

wrong ng-app here, it should be ng-init

wrong ng-app here, it should be ng-init
@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 (#6639)

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!

@@ -60,7 +60,7 @@ The loaded, transformed and rendered DOM is then called the <a name="view">"view

The first kind of new markup are the so called <a name="directive">"{@link directive directives}"</a>.
They apply special behavior to attributes or elements in the HTML. In the example above we use the
{@link ng.directive:ngApp `ng-app`} attribute, which is linked to a directive that automatically
{@link ng.directive:ngApp `ng-init`} attribute, which is linked to a directive that automatically
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ng-app is correct, here

Choose a reason for hiding this comment

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

Yes, ng-app is correct there. @IamAnn ng-init allows you to set a scope variable to something or execute scope functions when the template first initializes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@petebacondarwin, would it be good to maybe show the extra markup in the source viewer in the docs? I think this is causing confusion

Copy link
Author

Choose a reason for hiding this comment

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

but I didn't find any "ng-app" in this example. Only "ng-init" is defined on the first line in this example, am I correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the docs app is not showing it, it gets added programmatically, we need to fix that in the docs app because it's confusing

Copy link
Author

Choose a reason for hiding this comment

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

OK, I see what's the problem here. I'm wrong. You're correct. Sorry for the trouble. But I do think it's better to show the whole markups in the source viewer as caitp suggested. Thanks for your time

@petebacondarwin
Copy link
Contributor

I don't really want to dump the entire index.html into the docs as it would bloat the information. Perhaps we can have some flag on the example that says, "Don't add an ng-app to the index.html, because there is one inside the text of the example already?"

@caitp - What do you think?

@petebacondarwin
Copy link
Contributor

Or even, simply, "Don't wrap this example's index.html at all"? But then we would run into problems with adding in the correct script tags...

@caitp
Copy link
Contributor

caitp commented Mar 11, 2014

Perhaps we can have some flag on the example that says, "Don't add an ng-app to the index.html, because there is one inside the text of the example already?"

This doesn't seem too bad

@lefos987 lefos987 self-assigned this Mar 12, 2014
@lefos987 lefos987 added this to the Backlog milestone Mar 12, 2014
@lefos987 lefos987 removed their assignment Mar 12, 2014
petebacondarwin added a commit to angular/dgeni-packages that referenced this pull request Mar 18, 2014
By setting the ng-app-included attribute to true on an example we can
have the ng-app directive appear inside the example text rather than
being added externally to the generated index.html.

This is useful in examples that are actually show-casing the ng-app
functionality.

See angular/angular.js#6639
petebacondarwin added a commit that referenced this pull request Mar 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants