Data binding is not working


#1

I’m working on Angular2-Meteor, When i use routing inside the meteor account methods data binding is not working for the next route. But when i reload the page using refresh button data binding is working fine.

Below is the code on the client side:

Meteor.loginWithPassword({email:this.usernameCtrl.value},this.passwordCtrl.value,(error,result)=> {
if(error) {
console.log(error);
} else {
this.router.navigate([‘Dashboard’]);
}
});

Please help me with the work arounds.


#2

Add ngZone.

import { NgZone } from '@angular/core'

constructor(private _ngZone: NgZone) {}

// ...
this._ngZone.run(() => {
  this.router.navigate(['Dashboard']);
});
// ...

#3

It’s working!

Thanks for the reply.


#4

** You are welcome : )