Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular ng build--产品在HTML上引发属性错误_Angular_Angular Cli_Angular Cli V8 - Fatal编程技术网

Angular ng build--产品在HTML上引发属性错误

Angular ng build--产品在HTML上引发属性错误,angular,angular-cli,angular-cli-v8,Angular,Angular Cli,Angular Cli V8,我正在尝试构建Angular 8应用程序的生产版本,但我不断发现类型“*”上不存在属性“*”错误 已执行命令: ng build--prod=“true”--verbose=true 收到的错误: ERROR in src/app/shared/layout/sidenav/sidenav.component.html(1,46): : Property 'always' does not exist on type 'SidenavComponent'. src/app/shared/layo

我正在尝试构建Angular 8应用程序的生产版本,但我不断发现类型“*”上不存在
属性“*”
错误

已执行命令:

ng build--prod=“true”--verbose=true

收到的错误:

ERROR in src/app/shared/layout/sidenav/sidenav.component.html(1,46): : Property 'always' does not exist on type 'SidenavComponent'.
src/app/shared/layout/sidenav/sidenav.component.html(1,97): : Property 'scrollViewExtras' does not exist on type 'SidenavComponent'.
src/app/shared/layout/sidenav/sidenav.component.html(1,128): : Property 'scrollBarExtras' does not exist on type 'SidenavComponent'.
src/app/shared/layout/sidenav/sidenav.component.html(10,41): : Property 'sidenav' is private and only accessible within class 'SidenavComponent'.
这是src/app/shared/layout/sidenav/sidenav.component.html的前3行:

<ng-scrollbar class="notice-board-scrollbar" [shown]="always" [compact]="true" [invertY]="true" [viewClass]="scrollViewExtras" [barClass]="scrollBarExtras">
  <cdk-virtual-scroll-viewport ngScrollbarView smoothScroll itemSize="100">
    <mat-list role="list">

提前谢谢你的帮助

我最近遇到了这个问题,希望它能帮助其他人,因为它对我有用

在生产配置下更新angular.json

“aot”:false,
“vendorChunk”:没错,

“buildOptimizer”:false,

您缺少这些属性。如果不需要引用,请删除它们,或者添加属性。我该如何删除此类属性?此处出现此错误:
属性“title”在类型“DialogData”上不存在。
它确实引用此HTML片段:
如果删除它,我显然会丢失Angular Material提供的此组件。它确实链接到AOT编译器。我还不得不将其关闭,因为我使用的库不兼容并不断给出错误。我发现这也为我们解决了一个问题,即现有模型上的新属性无法正确编译。做出这种改变的副作用是什么?
riverman@vscode:~/projects/front$ ng version  

Angular CLI: 8.0.3
Node: 10.16.1
OS: linux x64
Angular: 8.0.2
... animations, cdk, common, compiler, compiler-cli, core
... elements, forms, language-service, platform-browser

Package                             Version
-------------------------------------------------------------
@angular-devkit/architect           0.800.3
@angular-devkit/build-angular       0.800.3
@angular-devkit/build-optimizer     0.800.3
@angular-devkit/build-webpack       0.800.3
@angular-devkit/core                8.0.1
@angular-devkit/schematics          8.0.3
@angular/cli                        8.0.3
@angular/material                   8.0.1
@angular/platform-browser-dynamic   8.0.1
@angular/router                     8.0.1
@ngtools/webpack                    8.0.3
@schematics/angular                 8.0.3
@schematics/update                  0.800.3
rxjs                                6.5.2
typescript                          3.4.5
webpack                             4.30.0