是否有任何配置设置可以删除这些空注释和空格?
我的构建命令是 ng build --environment prod --progress false --target production 和 tsconfig 是:
{
"compileOnSave": false,
"compilerOptions": {
"alwaysStrict": true,
"baseUrl": "/",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"lib": [ "es2015", "dom" ],
"module": "es2015",
"moduleResolution": "node",
"newLine": "CRLF",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"outDir": "./dist/out-tsc",
"removeComments": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"strictNullChecks": true,
"target": "es5",
"typeRoots": [ "./node_modules/@types" ]
}
}
@angular/cli:1.0.4
节点:7.2.1
操作系统:win32 x64
@角度/常见:4.1.3
谢谢。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这些注释中的每一个都是一个
ViewContainerRef,Angular 使用它来保留可以渲染视图的表达式的位置。当你有一个
ngIf时,如果表达式被计算为 false,显然 Angular 不会渲染该元素,但是一旦它变为 true,它就会渲染该元素,那么它是如何知道的把它放在哪里?当然还有其他表达式求值和视图模板绑定,但
ngIf是最容易理解的这就是这些评论的来源。