【发布时间】:2016-06-08 14:26:09
【问题描述】:
我已经安装了一个使用 Angular 2 制作的令人惊叹的管理项目。
这是项目的演示http://akveo.com/ng2-admin/#/pages/dashboard
我在这个项目中创建一个新页面时遇到问题!
在这里你可以找到我想做的事
https://akveo.github.io/ng2-admin/articles/013-create-new-page/
我的项目中的错误是:
pages.component.ts?7a77:76 Uncaught ReferenceError: New is not defined
所以基本上我有一个组件问题,我的项目找不到我要使用的组件。在页面 src/app/pages/pages.component.ts 我插入了以下行(如教程中所述 https://akveo.github.io/ng2-admin/articles/013-create-new-page/ )
{
name: 'New',
component: New, // here is the error
path: '/new',
}
如果需要,您可以使用他们的教程安装项目:
https://akveo.github.io/ng2-admin/articles/002-installation-guidelines/
感谢您的关注。
【问题讨论】:
-
您是否将
export class New添加到您的“new.component.module.js”中? -
是的,我添加了导出类 New。但正如 candidJ 在这个答案中提到的那样,我的导入有问题......
标签: javascript angular