angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -
tried switch new router in version "@angular/router": "3.0.0-beta.2" in combination "@angular/*": "2.0.0-rc.4", following official docs on componentrouter.
however, i'm facing issue when trying load app default homecomponent:
cannot find primary outlet load 'homecomponent' it seems has using templateurl , external html file instead of using inline template style.
homecomponent not shown in window , error printed console. however, when use link home component gets shown second hand.
as change from
templateurl: 'home.html' to
template: '<router-outlet></router-outlet>' error gone, homecomponent shown , routing works expected.
is known issue? work using templateurl? there have respect work?
the problem was, due app loading screen, <router-outlet></router-outlet> did not exist yet, due race condition. if need hide html part containing outlet, use [hidden] instead of *ngif, ensure outlet in dom , not removed conditionally.
Comments
Post a Comment