-
Notifications
You must be signed in to change notification settings - Fork 27.4k
template (Directive Def Object) description in $compile docs #8062
Comments
This looks like it was actually moved from the documentation of the If replace is truthy, then In either case, the original child nodes of the "current element" (that is to say, from the compilers perspective, the current element on the stack being compiled) are removed --- but they can be compiled if the The directive API is ridiculous, nobody is arguing that, but I hope that explains a little bit. @btford I think we should probably do a better job with that paragraph, because it really looks like it's describing |
Thanks @caitp. All you say is correct and known. Perhaps I should have emphasised that I think the docs should change. There are so many issues with the docs - it's such a shame. Sometimes, it seems the terminology picked is very very ambiguous. How can one contribute to making things right? I'm not authoritative enough to fork and propose doc pull requests. Shall I report an issue for everything I see? There's another, momentous (I believe) doc issue I believe should be addressed. I'll create a new issue and raise it to your attention. |
I agree that the docs should change, heh =) You're welcome to write a PR for this |
@Izhaki – I'm catching up after a long weekend. I agree that we can do better here. Thanks for your help! |
The docs (source) for
template
state:Let's do this bit by bit.
First, shouldn't 'current element' change to 'the element on which the directive is declared'.
Then:
For the following element:
This directive:
Will result in:
So the current element isn't replaced at all (
<my-directive>..</my-directive>
is still there).What am I missing here?
Which contents?
Isn't contents what's between tags? As in:
And which HTML?
Shouldn't it read:
Also:
I don't really understand this and I couldn't find anything on the Directives Guide.
It really seems that the text applies more to the (deprecated)
replace
property, rather than template.The text was updated successfully, but these errors were encountered: