I have an AngularDart 5 application with the following nested component structure:
The
mainComponentwith the main router outlet. Its path is/.Component
Aas the child of themainComponent. It also has its own router outlet and its path is/a.Component
1as a child ofA. Its path is/a/1.Component
2as another child ofA. Its path is/a/2.
Will switching from 1 to 2 trigger a reload/render of the page a?
E.g. when playing a video in a will switching from 1 to 2 make the video reload?
If so, can this be prevented?
I´m actually asking this question because for me when switching from 1 to 2 the page will reload/rerender.
EDIT:
Here are my routing configurations.
Routes of the main component:
class AppRoutePaths {
static final portal = RoutePath(path: 'portal');
static final workspace = RoutePath(path: 'workspace');
}
class AppRoutes {
static final _default = RouteDefinition.redirect(
path: '', redirectTo: AppRoutePaths.portal.toUrl());
static final _workspaceRoute = RouteDefinition(
routePath: AppRoutePaths.workspace,
component:
workspace_component.WorkspaceComponentNgFactory as ComponentFactory);
static final all = [_default, _workspaceRoute];
}
and the corresponding router outlet:
<router-outlet [routes]="AppRoutes.all"></router-outlet>
Those are the routes of component A:
class WorkspaceRoutePaths {
static final dashboard =
RoutePath(path: 'dashboard', parent: AppRoutePaths.workspace);
static final settings =
RoutePath(path: 'settings', parent: AppRoutePaths.workspace);
}
class WorkspaceRoutes {
static final dashboard = RouteDefinition(
routePath: WorkspaceRoutePaths.dashboard,
component: dashboard_component_template.DashboardComponentNgFactory as ComponentFactory);
static final settings = RouteDefinition(
routePath: WorkspaceRoutePaths.settings,
component: settings_component_template.SettingsComponentNgFactory as ComponentFactory);
static final _default = RouteDefinition.redirect(
path: '', redirectTo: WorkspaceRoutePaths.dashboard.toUrl());
static final all = [dashboard, settings, _default];
}
and the corresponding router outlet:
<router-outlet [routes]="WorkspaceRoutes.all"></router-outlet>