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

docs($compile): improve documentation on directive $scope usage #9727

Closed
wants to merge 1 commit into from
Closed

Conversation

psysp
Copy link
Contributor

@psysp psysp commented Oct 21, 2014

Add information about the behavior of several directives especially of their scopes when applied on a single element.

Close #5761

* same element request a new scope, only one new scope is created. The new scope rule does not
* apply for the root of the template since the root of the template always gets a new scope.
* **If set to `true`,** then a new scope will be created for this directive, otherwise it won't
* create a new scope and use the scope of its parent. If multiple directives on the same element
Copy link
Contributor

Choose a reason for hiding this comment

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

incorrect --- if scope is an object (but not true), it will still create a new scope.

@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@caitp caitp added this to the 1.3.x milestone Oct 22, 2014
@caitp caitp self-assigned this Oct 22, 2014
@psysp
Copy link
Contributor Author

psysp commented Oct 23, 2014

Currently I have no idea why the build fails. On my machine unit and e2e tests can all be executed successfully. Any ideas what I'm doing wrong?

@caitp
Copy link
Contributor

caitp commented Dec 3, 2014

@psysp it was a flake, your change didn't break anything.

Can you rebase this PR and squash commits? Also please make sure to sign the CLA --- unfortunately, while we used to be able to accept docs PRs with no CLA signature, we do require a signature now :( (I'm not happy about it either, but the good news is you only need to sign it once for all google open source projects!)

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

Add information about the behavior of several directives especially of their scopes when applied on a single element.
Add explanation for the different values the scope property of the directive declaration can have.

Close #5761
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Dec 9, 2014
@psysp
Copy link
Contributor Author

psysp commented Dec 9, 2014

Commits are squashed, cla is signed.

*
* **If set to `{}` (object hash),** then a new "isolate" scope is created. The 'isolate' scope differs from
* * **`false`:** No scope will be created for the directive. The directive will use its parent's scope.
Copy link
Contributor

Choose a reason for hiding this comment

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

this implies that false is somehow different from any other non-true, non-object value. The only cases that matter are true and object

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.

A more detailed documentation is needed for directive scopes
5 participants