refactor(test): <template>
/<ng-container>
/*-directives
- remove outer `<div>` in tests, - use `<ng-container>` instead of `<template>` where possible, - use *... instead of template (tag or attr) where possible. Fixes #13816
This commit is contained in:

committed by
Matias Niemelä

parent
d7f2a3c71b
commit
4b56f79328
@ -138,7 +138,7 @@ export function main() {
|
||||
@Component({
|
||||
selector: 'child',
|
||||
template:
|
||||
'(<template [ngTemplateOutlet]="templateRef" [ngOutletContext]="templateCtx"></template>)'
|
||||
'(<ng-container [ngTemplateOutlet]="templateRef" [ngOutletContext]="templateCtx"></ng-container>)'
|
||||
})
|
||||
class Child {
|
||||
@Input()
|
||||
|
@ -421,7 +421,7 @@ export function main() {
|
||||
TestBed.overrideDirective(
|
||||
SimpleDirective, {set: {providers: [{provide: 'service', useValue: 'parentService'}]}});
|
||||
const el = createComponent(
|
||||
'<div simpleDirective><template [ngIf]="true"><div *ngIf="true" needsService></div></template></div>');
|
||||
'<div simpleDirective><ng-container *ngIf="true"><div *ngIf="true" needsService></div></ng-container></div>');
|
||||
expect(el.children[0].children[0].injector.get(NeedsService).service)
|
||||
.toEqual('parentService');
|
||||
});
|
||||
|
Reference in New Issue
Block a user