ngOnInit not being called after router.navigate

元气小坏坏 提交于 2019-12-01 15:53:09

It seems this problem is still around, even after 5.0 has been released, at least the issue https://github.com/angular/angular/issues/18254 is not yet resolved. The good news is that there is a workaround described in the issue, using:

        this.zone.run(() => {
          this.router.navigateByUrl( url );
        });

I had the problem in the onAuthStateChanged callback for Firebase, and the above workaround helped.

The problem ended up being a bug in angular router, downgrading to version 4.1.3 fixed the issue. Hopefully this helps anyone else that tries using the latest version of angular with the Kinvey SDK.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!