4
我尝试从其他应用程序在我的应用程序中使用组件。我的项目是在同一个文件夹,所以我认为它会工作,但我得到“无法找到模块”异常。 有没有办法做到这一点?或另一种方式来实现这一目标?Angular2-使用另一个应用程序中的组件
我做了什么至今:
import { Component, OnInit } from '@angular/core';
import { OverviewPaginationComponent } from './../../../../overview/src/app/overview-pagination/overview-pagination.component.ts';
@Component({
moduleId: module.id,
selector: 'combi',
template: `
<overview-pagination><overview-pagination>
`,
styleUrls: ['combi.component.css'],
providers: [],
directives: [OverviewPaginationComponent]
})
export class CombiComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}
而且在systemConfig定义:
const barrels: string[] = [
// Angular specific barrels.
'@angular/core',
'@angular/common',
'@angular/compiler',
'@angular/forms',
'@angular/http',
'@angular/router',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/router-deprecated',
// Thirdparty barrels.
'rxjs',
// App specific barrels.
'app',
'app/shared',
'app/combi',
'../../overview/src/app/overview-pagination',
/** @cli-barrel */
];