-
Notifications
You must be signed in to change notification settings - Fork 883
[2.0] Drop <template [ngIf]="">
syntax from docs & examples
#2303
Comments
@vicb Can you point to where this appears in our docs and what we should be doing? As I recall, our only mention of In that discussion we have illustrative code. But that is in keeping with the explanation of how it works, not a recommendation.
|
@wardbell sorry can't tell where this is used in the docs - done a quick search before submitting the issue and the only place I can remember is indeed the template desugaring. What needs to be done is to convert
My mistake - I thought I had created an issue here but I realized it was actually for Sorry for that, we all have been very busy for the past weeks. To come back top our tag: <a>
<ng-container>
<b>
</ng-container>
<c>
gets rendered as <a><b><c> it was first introduce for i18n plurals: you want to be able to render ~"you have (no|one|x) messages" without adding extra markup around the counter. It was not possible before ng-container (you would have to add a Then while working on the API docs we realized that using different syntaxes if you have multiple root nodes is very confusing: <p *ngIf="enabled">wouhou</p>
<!-- vs -->
<template [ngIf]="enabled">
<p>wouhou</p>
<p>but why ??</p>
</template>
<!-- vs -->
<ng-container *ngIf="enabled">
<p>wouhou</p>
<p>neat !</p>
</ng-container> Hope this all make sense, and sorry again for the lack of coordination/anticipation on this one |
Move details of structural directives from template-syntax to structural-directives guide/structural-directives Add <ng-container> to structural-directives Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
Move details of structural directives from template-syntax to structural-directives guide/structural-directives Add <ng-container> to structural-directives Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
Move details of structural directives from template-syntax to structural-directives guide/structural-directives Add <ng-container> to structural-directives Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
…style, accuracy, understanding (angular#3110) Move details of structural directives from template-syntax to structural-directives guide Add <ng-container> to structural-directives Fix samples in both guides Touch up glossary Better conformance to google doc guidelines: we->you closes angular#2303, angular#2885
While working on the
NgIf
API docs we first thought about documenting:<single-root *ngIf=exp>
However this is confusing, we will drop the
<template []>
notation from the API docs - note that it will still be supported and there is no plan to remove the support.The preferred way will be
<ng-container *ngIf=exp><root1><root2></ng-container>
The
<ng-container>
tag is used to group nodes together and is not stamped out in the resulting DOM. It is not a directive but a special angular construct.We think that this change will remove some confusion and hard to remember syntax.
Please ping me if you need additional info.
/cc @IgorMinar
The text was updated successfully, but these errors were encountered: