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

doc(ngIf): mention multiElement in documentation #11104

Closed
wants to merge 1 commit into from

Conversation

marcin-wosinek
Copy link
Contributor

No description provided.

@@ -32,6 +32,9 @@
* Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`
* and `leave` effects.
*
* You can use ng-if across few dom elements. First element needs `ng-if-start="expresion"`, and the
* last one `ng-if-end`. Those two and all elements between will be hide/appear together.
Copy link
Member

Choose a reason for hiding this comment

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

will hide (without be)

@gkalpak
Copy link
Member

gkalpak commented Feb 19, 2015

I am not sure this should be documentd separately on every multiElement directive (currently ngRepeat, ngShow, ngHide, ngIf, ngSwitchWhen, ngSwitchDefault).

But it might be a good idea to introduce a @multiElement ngdoc annotation and have dgeni automatically add a note on such directives (maybe with a link to the https://docs.angularjs.org/api/ng/service/$compile#-multielement-).

@gkalpak gkalpak self-assigned this Feb 19, 2015
@gkalpak gkalpak added this to the Backlog milestone Feb 19, 2015
@gkalpak gkalpak removed their assignment Feb 19, 2015
@marcin-wosinek
Copy link
Contributor Author

while @multiElement seems to be reasonable, I wonder if all use cases are similar enough to be covered by one template.

@gkalpak
Copy link
Member

gkalpak commented Feb 19, 2015

It could be a minimal template pointing to the more detailed explanation in $compile's docs.

@Narretz
Copy link
Contributor

Narretz commented Feb 19, 2015

I agree with @gkalpak, an annotation seems like a good idea.

@marcin-wosinek
Copy link
Contributor Author

Do I get it right that this annotation should be implemented in https://github.com/angular/dgeni-packages, by a new module similar to ngdoc/tag-defs/priority.js & a bit of template in ngdoc/templates/api/directive.template.html

@Narretz
Copy link
Contributor

Narretz commented Feb 23, 2015

Yes, that is correct! Though I'd like to know what @petebacondarwin thinks of introducing a tag for multiElement.

@petebacondarwin
Copy link
Member

Sounds good to me

@petebacondarwin
Copy link
Member

The change has landed on dgeni-packages master, just need to run a release then we will need a docs PR to update the directives that support multi-element

@petebacondarwin
Copy link
Member

The only problem left is that ngSwitchWhen and ngSwitchDefault are not documented as separate directives to ngSwitch so it is not possible to apply the @multiElement to them. We should probably just bite the bullet and put a block of text into ngSwitch explaining this case.

@marcin-wosinek
Copy link
Contributor Author

Cool!

Later I've realized that multiElement can be the better shown as part of Usage section as:

<ANY
  ng-repeat-start="">
</ANY>
...
<ANY
  ng-repeat-end>
</ANY>

But with directive in place, this can be changed later.

@petebacondarwin
Copy link
Member

@marcin-wosinek - nice idea. If you fancied trying to do a PR with that change that would be cool

netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
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.

None yet

5 participants