void config(parentComponent, RouteDefinition config)

Given a component and a configuration object, add the route to this registry

Source

void config(dynamic parentComponent, RouteDefinition config) {
  config = normalizeRouteConfig(config, this);
  // this is here because Dart type guard reasons
  if (config is Route) {
    assertComponentExists(config.component, config.path);
  } else if (config is AuxRoute) {
    assertComponentExists(config.component, config.path);
  }
  var rules = this._rules[parentComponent];
  if (rules == null) {
    rules = new RuleSet();
    this._rules[parentComponent] = rules;
  }
  var terminal = rules.config(config);
  if (config is Route) {
    if (terminal) {
      assertTerminalComponent(config.component, config.path);
    } else {
      this.configFromComponent(config.component);
    }
  }
}