import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
@NgModule({
declarations: [
],
imports: [
CommonModule
],
exports: [ //<-这个数组什么用?
]
})
export class CustomModule { }
自定义module的时候,这个exports有什么用?把几个自定义的component只要放在declarations中就可以了,不放到exports中也可以用。而自定义的pipe如果不放到exports中就访问不到,求解!
不exports的组件,只能在当前模块中(也就是 declarations 中有此组件的那个模块)中使用。
其他模块是无法使用的。