使用其他模块中共享模块的组件进行角度4

时间:2018-04-29 09:48:09

标签: angular

这是我项目的结构,我有一个名为StarComponent的通用组件在sharedModule中。如何在ClientListComponent中使用StarComponent。

毋庸置疑,我已经在sharedModule中添加了StarComponent导出和声明数组,并在(app.module或adminModule或clinetModule)中导入了sharedModule,但它们都不起作用!

---app
------app.module.ts
------sharedModule
------------------StarComponent
------adminModule
-----------------clinetModule
-----------------------------ClientListComponent

已更新:

我准备了一个示例来表明它不起作用

演示: https://stackblitz.com/edit/angular-aceiz9

1 个答案:

答案 0 :(得分:1)

如果你有

PUT /twitter/_doc/1
{
  "fullname" : "John Doe",
  "text" : "twitter test test test "
}

PUT /twitter/_doc/2
{
  "fullname" : "Jane Doe",
  "text" : "Another twitter test ..."
}
GET /twitter/_doc/1/_termvectors
{
  "fields" : ["text"],
  "offsets" : true,
  "payloads" : true,
  "positions" : true,
  "term_statistics" : true,
  "field_statistics" : true
}