RouteDefinition constructor

RouteDefinition({
  1. String? path,
  2. ComponentFactory<Object>? component,
  3. bool? useAsDefault,
  4. dynamic additionalData,
  5. RoutePath? routePath,
})

Define a route from path that loads component into an outlet.

import 'contact_view.template.dart';

new RouteDefinition(
  path: 'contact',
  component: ContactViewComponentNgFactory,
);

At most one route may be set to useAsDefault, which means it will be automatically inferred to be in use if there are no matching routes for a given outlet.

Another way to create a RouteDefinition is by using a RoutePath. The routePath can also be used for other applications, such as creating URLs.

RoutePath contactRoute = new RoutePath(
  path: 'contact',
);

new RouteDefinition(
  routePath: contactRoute,
  component: ContactViewComponentNgFactory,
);

Implementation

factory RouteDefinition({
  String? path,
  ComponentFactory<Object>? component,
  bool? useAsDefault,
  dynamic additionalData,
  RoutePath? routePath,
}) = ComponentRouteDefinition._;