У меня есть приложение, размещенное на App Engine (Стандартная среда, python27) и использующее Angular 7.2.0.
У меня настроены следующие обработчики App Engine:
handlers:
- url: /public
static_dir: dist/my-app
secure: always
- url: /.*
static_files: dist/my-app/index.html
upload: dist/my-app/index.html
secure: always
Со следующим модулем маршрутизации приложений:
const routes: Routes = [
{
path: '',
component: MainComponent,
canActivate: [AuthGuard],
children: [
{
path: '',
component: HomepageComponent
},
{
path: 'backoffice',
children: [
{
path: '',
component: BackofficeComponent,
children: [
{
path: 'general',
component: GeneralSectionComponent
},
{
path: '',
redirectTo: 'general',
pathMatch: 'full'
}
]
}
]
}
]
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Достигнув /backoffice/general
с роутером, ссылка работает отлично.
Однако при вводе URL https://my-app.com/backoffice/general
страница загружается, но макет не работает, и отображается предупреждение Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?
.
Как я могу разрешить пользователям переходить к определенному дочернему маршруту в приложении Angular путем непосредственного ввода целевого URL?