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

Clarification stemming from my own issues #4503

Closed
wants to merge 2 commits into from
Closed

Clarification stemming from my own issues #4503

wants to merge 2 commits into from

Conversation

gdennie
Copy link
Contributor

@gdennie gdennie commented Oct 18, 2013

It is instructive to give literal examples that reflect common (my) experience of the problem. :)

It is instructive to give literal examples that reflect common (my) experience of the problem. :)
@mary-poppins
Copy link

Thanks for the PR!

  • Contributor signed CLA now or in the past
    • If you just signed, leave a comment here with your real name
  • PR's commit messages follow the commit message format

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!

@caitp
Copy link
Contributor

caitp commented Oct 18, 2013

It might be good to clarify the issue seen in #4505 --- <ng-include> (or other transclude: 'element' directives) will add at least one Comment node to the DOM, and effectively not have a single parent. In ngInclude's case in particular, this is probably not a desirable behaviour, but regardless.

It's great that the docs mention that you can only replace with a single element and its children, but to my knowledge the caveat with ngInclude in particular is not mentioned anywhere, and it might confuse people.

@@ -4,7 +4,9 @@
@description

When a directive is declared with `template` (or `templateUrl`) and `replace` mode on, the template must have exactly one root element.
Otherwise the replacement operation would result in a single element being replaced with multiple elements or nodes, which is unsupported and not commonly needed in practice.
That is, the text of the template property or the referenced by the templateUrl must be contained within an html elemen.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo "elemen"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I tried to correct after submission but could not find a way to do so.

From: Pete Bacon Darwin [mailto:[email protected]]
Sent: October 18, 2013 3:06 PM
To: angular/angular.js
Cc: gdennie
Subject: Re: [angular.js] Clarification stemming from my own issues (#4503)

In docs/content/error/compile/tplrt.ngdoc:

@@ -4,7 +4,9 @@
@description

When a directive is declared with template (or templateUrl) and replace mode on, the template must have exactly one root element.
-Otherwise the replacement operation would result in a single element being replaced with multiple elements or nodes, which is unsupported and not commonly needed in practice.
+That is, the text of the template property or the referenced by the templateUrl must be contained within an html elemen.

typo "elemen"


Reply to this email directly or view it on GitHub https://github.com/angular/angular.js/pull/4503/files#r7071027 .Image removed by sender.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can edit the file again within GitHub: https://github.com/gdennie/angular.js/edit/patch-5/docs/content/error/compile/tplrt.ngdoc

Alternatively, you can simply edit on your local copy (make sure you've checked out patch-5). When you're finished,

$ git commit -a --amend

And force-push

jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 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.

4 participants