Routing issues in rendering AngularJS components from Angular2 routes

377 Views Asked by At

I have a Hybrid(Angular1 and Angular2) repo which having mix of Angular1 and Angular2 routers. Followed the sample from https://vsavkin.com/migrating-angular-1-applications-to-angular-2-in-5-simple-steps-40621800a25b#.1hmxbfijw., But when I try to use AngularJS component (in the example <messages> )component inside Angular2 Component (in the example <settings> ) which is rendered from Angular2 routing, I was getting a blank page.. So downgraded the ng2Root comp in ng1 context. as suggested here https://github.com/angular/angular/issues/12965

So After that the routing strategy stopped working.. here is the repo which describes the problem.

https://github.com/a5hik/ng1ng2

PS: When I do after bootstrap platformRef.injector.get(Router).initialNavigation(); I can able to navigate Angular2 routing (in the example \settings) page directly from the browser, but not the other pages are working. which is the rest of the AngularJS routing are not working.

Environment:

angular-cli: 1.0.0-beta.26
node: 7.0.0
os: darwin x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/platform-browser: 2.4.5
@angular/upgrade: 2.4.5
@angular/router: 3.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/platform-server: 2.4.5
@angular/compiler-cli: 2.4.5
@ngtools/webpack: 1.2.4
0

There are 0 best solutions below