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:
@ -2932,6 +2932,28 @@ describe('compiler compliance', () => {
|
||||
expectEmit(source, SomeDirectiveDefinition, 'Incorrect SomeDirective.ngDirectiveDef');
|
||||
});
|
||||
|
||||
it('should not throw for empty property bindings on ng-template', () => {
|
||||
const files = {
|
||||
app: {
|
||||
'example.ts': `
|
||||
import {Component, NgModule} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template: '<ng-template [id]=""></ng-template>'
|
||||
})
|
||||
export class MyComponent {
|
||||
}
|
||||
|
||||
@NgModule({declarations: [MyComponent]})
|
||||
export class MyModule {}`
|
||||
}
|
||||
};
|
||||
|
||||
expect(() => compile(files, angularFiles)).not.toThrow();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
describe('inherited base classes', () => {
|
||||
|
Reference in New Issue
Block a user