angular - 在组件中使用 Angular Basic 管道
问题描述
我试图在我的 Ionic 项目中的一个组件中使用 Angular 现成的管道(即日期、大写),但它给出了一个错误。
我在 src/app 文件夹中有一个组件文件夹。每个组件都在各自的文件夹中,其中包含 scss、html 和 ts 文件。
<div class="day">
{{ day | date }}
</div>
<div class="month">
{{ month | uppercase }}
</div>
我必须在某处导入 DateModule 吗?
解决方案
没有任何名为 DateModule 的模块。
日期管道是 CommonModule 的一部分(参见 @angular/common 包)。
CommonModule 导出由 BrowserModule 重新导出,它自动包含在根 AppModule 中(也在 Ionic 项目中)。
推荐阅读
- mqtt - How is the Sparkplug is_historical metric property used?
- html - 固定背景附件的问题
- tvos - UIUserInterfaceStyle 在每次重新打开时恢复为 UIUserInterfaceStyleDark
- r - generate a special matrix (max value of column sum is minimum) with given number of column from a vector
- c# - swagger 4.0 Asp.net core 2.2 需要的body参数
- sql - SSIS OnPostExecute event: How to see the execution result?
- google-cloud-bigtable - 间歇性错误:java.io.IOException:无法提前阅读源:BigtableSource{config=BigtableConfig{projectId=
- excel - autofilter not including all rows when filtering using vba
- reactjs - Jest 测试文件未从 .env.test 读取 env 变量
- python - setattr / getattr / self.__dict__ 是否接受通常不允许的属性名称?