fix(ivy): error for empty bindings on ng-template (#30829)
Fixes Ivy throwing an error if it runs into an empty property binding on an `ng-template` (e.g. `<ng-template [something]=""></ng-template>`) by not generating an update instruction for it. Fixes #30801. This PR resoves FW-1356. PR Close #30829
This commit is contained in:
@ -204,6 +204,20 @@ describe('NgTemplateOutlet', () => {
|
||||
fixture.componentInstance.value = 'baz';
|
||||
detectChangesAndExpectText('');
|
||||
});
|
||||
|
||||
// https://github.com/angular/angular/issues/30801
|
||||
it('should not throw if the context is left blank', () => {
|
||||
const template = `
|
||||
<ng-template #testTemplate>test</ng-template>
|
||||
<ng-template [ngTemplateOutlet]="testTemplate" [ngTemplateOutletContext]=""></ng-template>
|
||||
`;
|
||||
|
||||
expect(() => {
|
||||
fixture = createTestComponent(template);
|
||||
detectChangesAndExpectText('test');
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@Injectable()
|
||||
|
Reference in New Issue
Block a user