Open ShoulderMonkey opened 2 months ago
FWIW, I have the same problem in one Angular app, but not in another. I found that in the app where the problem occurs, the decorator assigns the BlockUI instance to the component's prototype but the component object has its own property with an "undefined" value. In the app where everything works, the BlockUI instance is still set into the prototype but the component object itself doesn't have the property and is getting the prototype value.
... and a possible workaround for that is to set "useDefineForClassFields" to false in typescript options for the time being
I'm upgrading to angular 18 from angular 17 in one of my projects and i'm getting error where using
@BlockUI()blockUI!: NgBlockUI
gives error:
TypeError: Cannot read properties of undefined (reading 'start')
had to switch to using the BlockUIService instead and specifying name in selector like so:
`<block-ui [template]="foregroundSpinner" name="test" >
constructor( private blockUI: BlockUIService ){
this.blockUI.start('test') `