victos / ng-busy Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
'@component({
selector: 'some',
template: <div [ngBusy]="busy"></div>
})
busy: Subscription;'
But it doesn't work. Work only when you include 'busy' in array. Example '<div [ngBusy]="[busy]">'.
My version angular 5.2.2 and
Hi all,
I'm currently adding ng-busy to my angular 5.2.1 application using WebPack with AOT. I've hit a few issues using the guide from npm (https://www.npmjs.com/package/ng-busy) and just thought I'd post them here for anyone who might be experiencing the same troubles, and maybe a fix/documentation update in the future (assuming its not something that is specific to my setup which it very well could be).
<-- Simple syntax does not work. --> <div [ngBusy]="busy">
BUT
<-- Advanced syntax does work --><div [ngBusy]="{busy: busy}">
In the root application module: "NgBusyModule.forRoot({})" results in "Property 'forRoot' does not exist on type 'typeof ngBusyModule'
trying to use a component in the Application module, the component must be added to the list of entryComponents:
declarations: [
...
BrowserAnimationsModule,
NgBusyModule,
CustomBusyComponent,
...
],
entryComponents: [
...
CustomBusyComponent,
...
],
imports: [ ... ],
I'm also getting a non-breaking error that I've been unable to resolve. When adding message as in the documentation: "ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'null: undefined'. Current value: 'null: Loading...'. It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"
Thanks
onStopBusy
never emmited, backdrop doesn't close. Any suggestions?
Using ng-busy 1.4.3 and Angular 5.x. Using an Angular Service injected into Component that returns an Observable:
Inside the service:
public doIt(): Observable<any> { return Observable.create(s => { setTimeout(() => { console.log("We are done") s.complete(); }, 5000); }); }
In the component:
this.busy = this.myService.doIt().subscribe();
The indicator does not appear.
However if I take all the code inside the service and move it inline to the component it works fine! So the issue appears to be related to getting the observable from a service.
Is there any way to avoid this annoying message?
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: false'. Current value: 'ngIf: true'
"Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: false'. Current value: 'ngIf: true'.
at viewDebugError (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:8717:15)
at expressionChangedAfterItHasBeenCheckedError (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:8705:12)
at checkBindingNoChanges (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:8807:15)
at checkNoChangesNodeInline (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:11673:9)
at checkNoChangesNode (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:11662:9)
at debugCheckNoChangesNode (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:12269:24)
at debugCheckDirectivesFn (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:12197:13)
at Object.eval [as updateDirectives] (ng:///NgBusyModule/NgBusyComponent.ngfactory.js:26:5)
at Object.debugUpdateDirectives [as updateDirectives] (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:12186:21)
at checkNoChangesView (webpack://%5Bname%5D_%5Bhash%5D/./node_modules/@angular/core/fesm5/core.js?:11561:14)"
I am updating a project to use your module from devyumao's angular2-busy. Once I updated, I noticed that the slide in animation when the throbber appears is gone. I also couldn't see the effect in your demo. Is this intended? I couldn't see anything in the CSS file that changed between the two projects to lose the animation.
Thanks for updating the project, and thanks for the help.
Looks like the NgBusy needs an update for Angular 6 to allow for use with RxJS v6 outside of compatibility mode. Might be worth a version bump to v2.0? Only needs to replace the imports using rxjs/Subscription
a handful of times to be just rxjs
.
I'd PR an update, but not sure what needs to change in build.js
globals and external.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.