refactor: change remaining `<template>` to `<ng-template>` (#14706)
This commit is contained in:
parent
bc9e1debf2
commit
d1182af1a4
|
@ -21,9 +21,9 @@ import {SwitchView} from './ng_switch';
|
||||||
* @howToUse
|
* @howToUse
|
||||||
* ```
|
* ```
|
||||||
* <some-element [ngPlural]="value">
|
* <some-element [ngPlural]="value">
|
||||||
* <template ngPluralCase="=0">there is nothing</template>
|
* <ng-template ngPluralCase="=0">there is nothing</ng-template>
|
||||||
* <template ngPluralCase="=1">there is one</template>
|
* <ng-template ngPluralCase="=1">there is one</ng-template>
|
||||||
* <template ngPluralCase="few">there are a few</template>
|
* <ng-template ngPluralCase="few">there are a few</ng-template>
|
||||||
* </some-element>
|
* </some-element>
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -89,8 +89,8 @@ export class NgPlural {
|
||||||
* @howToUse
|
* @howToUse
|
||||||
* ```
|
* ```
|
||||||
* <some-element [ngPlural]="value">
|
* <some-element [ngPlural]="value">
|
||||||
* <template ngPluralCase="=0">...</template>
|
* <ng-template ngPluralCase="=0">...</ng-template>
|
||||||
* <template ngPluralCase="other">...</template>
|
* <ng-template ngPluralCase="other">...</ng-template>
|
||||||
* </some-element>
|
* </some-element>
|
||||||
*```
|
*```
|
||||||
*
|
*
|
||||||
|
|
|
@ -352,7 +352,7 @@ export function main() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should support injecting `NgFor` and get an instance of `NgForOf`', async(() => {
|
it('should support injecting `NgFor` and get an instance of `NgForOf`', async(() => {
|
||||||
const template = `<template ngFor [ngForOf]='items' let-item test></template>`;
|
const template = `<ng-template ngFor [ngForOf]='items' let-item test></ng-template>`;
|
||||||
fixture = createTestComponent(template);
|
fixture = createTestComponent(template);
|
||||||
const testDirective = fixture.debugElement.childNodes[0].injector.get(TestDirective);
|
const testDirective = fixture.debugElement.childNodes[0].injector.get(TestDirective);
|
||||||
const ngForOf = fixture.debugElement.childNodes[0].injector.get(NgForOf);
|
const ngForOf = fixture.debugElement.childNodes[0].injector.get(NgForOf);
|
||||||
|
|
|
@ -50,8 +50,8 @@ export function main() {
|
||||||
it('should display the template according to the exact numeric value', async(() => {
|
it('should display the template according to the exact numeric value', async(() => {
|
||||||
const template = '<div>' +
|
const template = '<div>' +
|
||||||
'<ul [ngPlural]="switchValue">' +
|
'<ul [ngPlural]="switchValue">' +
|
||||||
'<template ngPluralCase="0"><li>you have no messages.</li></template>' +
|
'<ng-template ngPluralCase="0"><li>you have no messages.</li></ng-template>' +
|
||||||
'<template ngPluralCase="1"><li>you have one message.</li></template>' +
|
'<ng-template ngPluralCase="1"><li>you have one message.</li></ng-template>' +
|
||||||
'</ul></div>';
|
'</ul></div>';
|
||||||
|
|
||||||
fixture = createTestComponent(template);
|
fixture = createTestComponent(template);
|
||||||
|
|
|
@ -517,7 +517,8 @@ function declareTests({useJit}: {useJit: boolean}) {
|
||||||
it('should assign the TemplateRef to a user-defined variable', () => {
|
it('should assign the TemplateRef to a user-defined variable', () => {
|
||||||
const fixture =
|
const fixture =
|
||||||
TestBed.configureTestingModule({declarations: [MyComp]})
|
TestBed.configureTestingModule({declarations: [MyComp]})
|
||||||
.overrideComponent(MyComp, {set: {template: '<template ref-alice></template>'}})
|
.overrideComponent(
|
||||||
|
MyComp, {set: {template: '<ng-template ref-alice></ng-template>'}})
|
||||||
.createComponent(MyComp);
|
.createComponent(MyComp);
|
||||||
|
|
||||||
const value = fixture.debugElement.childNodes[0].references['alice'];
|
const value = fixture.debugElement.childNodes[0].references['alice'];
|
||||||
|
|
Loading…
Reference in New Issue