Angular 2 Router error, Route config should contain exactly one “component”, “loader”, or “redirectTo” property

后端 未结 8 1787
南笙
南笙 2021-01-18 05:35

This is my setup:

import {bootstrap} from \'angular2/platform/browser\';
import {Component} from \'angular2/core\';
import {LocationStrategy, APP_BASE_HREF,          


        
相关标签:
8条回答
  • 2021-01-18 06:32

    I had the same issue. My import was not surrounded by curly braces, so it was undefined. The problem is the cryptic error message, which should state that the component you provided is undefined for the @RouteConfig.

    0 讨论(0)
  • 2021-01-18 06:32

    In my case it was the mismatch of the component name in import {TestComponent} and "export class TestingComponent"

    TestingComponent should be TestComponent.

    0 讨论(0)
提交回复
热议问题