angular2-busy
angular2-busy copied to clipboard
ERROR in Error encountered resolving symbol values statically
Hi, I'm using [email protected] and [email protected]. I have followed the readme to customize the BusyModule in app.module as below:
import {NgModule} from '@angular/core';
import {BusyModule, BusyConfig} from 'angular2-busy';
@NgModule({
imports: [
// ...
BusyModule.forRoot(
new BusyConfig({
message: 'Don\'t panic!',
backdrop: false,
template: `
<div>{{message}}</div>
`,
delay: 200,
minDuration: 600
})
)
],
// ...
})
export class AppModule
however, when I run the application with ng serve
, I got the error:
ERROR in Error encountered resolving symbol values statically. Calling function 'BusyConfig', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/WebApp/src/app/app.module.ts, resolving symbol AppModule in C:/WebApp/src/app/app.module.ts, resolving symbol AppModule in C:/WebApp/src/app/app.module.ts
Please help.
it looks like this package is not beeing updated and from what i have gathered here is the problem: angular-cli and webpack want to do some checking on the packages we use to bruild a good runtime bundle. this means that feature modules like this one need to be updated to use updated modules and to also generate a metadata json file that they can use to help the build process.
this package is one of several that have the same issues.
we can try to update this package or find a different one or fork from this one. i am looking at the options but not sure yet which way to go.
i just started a fork from this and will see if i can update it to work with angular cli see here: https://github.com/figuerres/ng-busy give me a few days and then see if you want to add to this.
That's great Danny! I'm looking forward to your updates.
Any update on this one~~?
@BaronChen please post on my fork if you are asking about that. Thanks.
Has anyone fixed this bug?
This week for sure I will have some time to work on this and I will check on this and the package, for now edit the feature code and skip the for root option. That's what I did in my app for now.
Another way of getting around this problem is to typecast your object to BusyConfig.
import [
...
BusyModule.forRoot(<BusyConfig>{message: 'Dont Panic! ;)', minDuration: 500})
]
~~Hi, the trick / workaround proposed by @MohibWasay solved the problem in my case. Thanks @MohibWasay !~~
Eratum, finally @MohibWasay did not solve the problem, the config seems to not being taken into account with the cast in our case.
any updates on this issue?
Solved the problem here module.ts:
import { BusyModule, BusyConfig, BUSY_CONFIG_DEFAULTS } from 'angular2-busy';
const busyConfig: BusyConfig = {
message: 'Processing..',
delay: 200,
template: BUSY_CONFIG_DEFAULTS.template,
minDuration: BUSY_CONFIG_DEFAULTS.minDuration,
backdrop: true,
wrapperClass: BUSY_CONFIG_DEFAULTS.wrapperClass
};
then:
@NgModule({
imports: [
...
BusyModule.forRoot(busyConfig),
...
],
@Jaimera It works for me :heart: