Angular 2 Initial loading progress

You could try to add a second script in your index.html, which would then load all your other files (just as the index.html is doing now). Then you’d have a bunch of AJAX requests for your files and could add them to the DOM. To track the progress, you could try to use an HTTP … Read more

background geolocation ionic 3 not updating

Looking at examples e.g dnchia/Ionic3-Background-Geolocation you would configure the interval on the background, as well as the periodic foreground send gps.ts startTracking(interval) { console.log(‘started tracking’) const config: BackgroundGeolocationConfig = { desiredAccuracy: 10, stationaryRadius: 20, distanceFilter: 30, debug: false, // enable this hear sounds for background-geolocation life-cycle. stopOnTerminate: false, interval: interval }; app.component.ts interval = 30000; … Read more

Angular (v5) service is getting constructed before APP_INITIALIZER promise resolves

I had also a simmilar issue what solved the issue for me was to use Observable methods and operators to do everything. Then in the end just use the toPromise method of the Observable to return a Promise. This is also simpler because you don’t need to create a promise yourself. The AppConfig service will … Read more

Dynamic routing based on external data

In the new router (>= RC.3) https://angular.io/docs/ts/latest/api/router/index/Router-class.html#!#resetConfig-anchor resetConfig can be used to load new routes router.resetConfig([ { path: ‘team/:id’, component: TeamCmp, children: [ { path: ‘simple’, component: SimpleCmp }, { path: ‘user/:name’, component: UserCmp } ] } ]); You would have a custom routerLink directive or just some link or button that calls an event … Read more

Why do I need to call detectChanges() with the default change detection strategy? [duplicate]

I have solved the problem. Another component sending notifications to this component was running Observable.fromEvent() outside the Angular zone, so change detection was not happening automatically in response to these events. This post on zones and this StackOverflow post on the issue held the solution!

How to wait for 2 Actions in @ngrx/effects

I am new to RXJS but what about this. You can remove {dispatch: false} if you change the tap to a switchMap. @Effect({dispatch: false}) public waitForActions(): Observable<any> { const waitFor: string[] = [ SomeAction.EVENT_1, SomeAction.EVENT_2, SomeAction.EVENT_3, ]; return this._actions$ .pipe( ofType(…waitFor), distinct((action: IAction<any>) => action.type), bufferCount(waitFor.length), tap(console.log), ); }