无法使用ng build

编程入门 行业动态 更新时间:2024-10-27 20:29:12
本文介绍了无法使用ng build --prod构建angular 2项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经使用角材料创建了一个角2项目.我正在尝试使用Firebase部署过程托管我的项目.

I have created a angular 2 project using angular material. I am trying to host my project using firebase deployment process.

我的应用程序已在服务器上成功运行.但是,当我尝试构建我的应用程序时,它给我以下错误,如下图所示.

My application is successfully running on my server.But when I am trying to build my application its giving me the following error as shown below in the image.

请帮助我解决这个问题

推荐答案

解决方案:针对let- is only support for ng-template错误.

您已经在您的HTML端的某些地方使用了let-variablename.该错误表明您不能在任何地方使用它而不是ng-template.

You have use let-variablename some where in you html side. The error says you can't use it anywhere instead of ng-template.

在使用NgForOf

如下所示,

如果您正在使用下面的这种代码.

if you are using this kind of below code.

<div ngFor let-variableName [ngForOf]="ListOfData" let-index=index ></div>

然后应将其更改为ng-template

<ng-template ngFor let-variableName [ngForOf]="ListOfData" let-index=index ></ng-template>

解决方案2

在下面将其用于循环

Solution 2

Use this below for loop

*ngFor="let variableName of ListOfData; let index = index"

您正在使用哪种而不是种类

instead of which is you are using kind

ngFor let-variableName [ngForOf]="ListOfData" let-i=index

我希望以上两种解决方案都能对您有所帮助.

I hope this above both solutions are helps you.

使用以下命令代替您的

ng build --prod --aot=false --build-optimizer=false

更多推荐

无法使用ng build

本文发布于:2023-11-26 06:11:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632947.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ng   build

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!