为什么会出现错误“选择器与任何元素都不匹配”?

2024-03-27

我的index.html正文:

  <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>

和忘记.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 {

}

忽略路由部分。 我收到以下错误: 错误:未捕获(承诺中):选择器“my-login”与任何元素都不匹配

选择器“my-login”不匹配任何元素

这些文件中没有我的登录名,我也不需要它! 怎么了?


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么会出现错误“选择器与任何元素都不匹配”? 的相关文章

随机推荐