添加新的角度组件npm安装和导入的步骤是什么?

问题描述

添加新角度分量的步骤是什么?

  1. <policies> <inbound> <set-header name="Content-Type" exists-action="override"> <value>text/xml</value> </set-header> <set-body template="liquid"> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header /> <soapenv:Body> <tem:GetOpenOrders> <!--Optional:--> <tem:cust>{{body.Envelope.Body.GetOpenOrders.cust}}</tem:cust> </tem:GetOpenOrders> </soapenv:Body> </soapenv:Envelope> </set-body> <base /> </inbound> <backend> <base /> </backend> <outbound> <set-body template="liquid"> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetOpenOrdersResponse xmlns="http://tempuri.org/"> <GetOpenOrdersResult xmlns:a="http://schemas.datacontract.org/2004/07/FazioAPISoap" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> {% for summary in body.Envelope.Body.GetOpenOrdersResponse.GetOpenOrdersResult.OrderSummary -%} <a:OrderSummary><a:order_id>{{summary.order_id}}</a:order_id></a:OrderSummary> {% endfor -%} </GetOpenOrdersResult> </GetOpenOrdersResponse> </s:Body> </s:Envelope> </set-body> <set-header name="Content-Type" exists-action="override"> <value>text/xml</value> </set-header> <base /> </outbound> <on-error> <base /> </on-error> </policies>
  2. 导入 添加到HTML时给出错误 例如:
npm install

.TS模块中的

npm i --save @angular/material/tree'
    html中的
  1. import {MatTreeModule} from '@angular/material/tree'
    

它给出错误mat-tree-node不是一个已知元素

解决方法

使用 npm我@ angular / material

然后 从'@ angular / material / tree'导入{MatTreeModule}

,

您不能像在这里那样安装特定的模块:

npm i --save @angular/material/tree'

使用NPM可以将完整的库添加到项目中,要将Angular Material库添加到项目中,应遵循此处的步骤,它还说明了如何将组件添加到模块https://material.angular.io/guide/getting-started

步骤:

  1. 运行ng add @angular/material
  2. 导入要在模块中使用的Material模块
import { MatTreeModule } from '@angular/material/tree';
…
@NgModule ({....
  imports: [...,MatTreeModule,…]
})
,

使用Angular Material,您必须在app.module.ts文件中进行导入。并将其置于“导入”下。

我建议您查看此页面:https://material.angular.io/guide/getting-started

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...