Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 错误:意外值';未定义';由模块导出';动态模板';_Angular_Module - Fatal编程技术网

Angular 错误:意外值';未定义';由模块导出';动态模板';

Angular 错误:意外值';未定义';由模块导出';动态模板';,angular,module,Angular,Module,Angular2能够动态生成表单(模型驱动表单),而不是手动生成表单(模板驱动表单) 我有一个动态表单的变体,其中整个表单生成功能作为一个模块公开(Angular RC5) 但它会因以下错误而中断(出现在开发人员控制台中) 这是普朗克 修复了它。DynamicFormComponent有一个拼写错误。它被拼写为DynamicForm。以动态形式更正了它。module.ts我也有同样的错误。 我把它换了 export * from './myComponent' 借 他也犯了类似的错误。发现这是

Angular2能够动态生成表单(模型驱动表单),而不是手动生成表单(模板驱动表单)

我有一个动态表单的变体,其中整个表单生成功能作为一个模块公开(Angular RC5)

但它会因以下错误而中断(出现在开发人员控制台中)

这是普朗克


修复了它。DynamicFormComponent有一个拼写错误。它被拼写为DynamicForm。以动态形式更正了它。module.ts

我也有同样的错误。 我把它换了

export * from './myComponent'


他也犯了类似的错误。发现这是由我的index.ts文件中的一个重复导出引起的:

export * from './article/article.component';
export * from './body/body.component'; //first export
export * from './cards/cards.component';
export * from './body/body.component'; //repeated export

他也犯了类似的错误。这是由我的库的
NgModule
中的导入引起的。它不是直接导入,而是从
public_api.ts
文件(条目文件)导入的

通过改变来修复它

从“public_api”导入{MyDirective}


import{MyDirective}from./my directive/my directive.directive'

在我的例子中,这是因为我在子模块“a”中创建了一个路由文件,但没有在根模块中导入该路由文件,即使子模块“a”已导入根模块

从'src/app/module-A/A.module'导入{A};
从'src/app/module-a/a.routes'导入{ARoutes};//这在我的根应用程序模块中丢失了

我从这里得到了修复()并且对我有效。
组件元数据中的拖尾昏迷导致了这一点。

它帮助了我。谢谢
export {MyComponent} from './myComponent'
export * from './article/article.component';
export * from './body/body.component'; //first export
export * from './cards/cards.component';
export * from './body/body.component'; //repeated export