why getting the error “The selector did not match any elements”?

左心房为你撑大大i 提交于 2019-12-12 19:21:30

问题


my index.html body:

  <body>
    <my-forget>Loading...</my-forget>

    <router-outlet></router-outlet>

    <script>
        System.config({
            packages: {
                app: {
                    format: 'register',
                    defaultExtension: 'js'
                }
            }
        });
        System.import('app/boot')
                .then(null, console.error.bind(console));
    </script>
    </body>
    </html>

and forget.component.ts:

import {Component} from 'angular2/core';
import{RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {LoginComponent} from './login.component';

@RouteConfig([
  {path:'/app', name:'login-page', component:'LoginComponent'},
  {path:'/*other', name:'other', redirectTo:['login-page']}
])

@Component({
  selector: 'my-forget',
  templateUrl: '../templates/forget.component.html',
  directives: [ROUTER_DIRECTIVES]
})
export class ForgetComponent {

}

Ignore routing parts. I'm getting the following errors: Error: Uncaught (in promise): The selector "my-login" did not match any elements

The selector "my-login" did not match any elements

I don't have my-login in these files and i don't need it! What is wrong?

来源:https://stackoverflow.com/questions/38565942/why-getting-the-error-the-selector-did-not-match-any-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!