目前,已完成步骤的图标是"创建".如何将其更改为其他材质图标行,例如"完成"?
<mat-vertical-stepper>
<mat-step label="Agreement Preparation">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
<mat-step label="Ready for Biometric">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
<mat-step label="Document in Submission">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
</mat-vertical-stepper>
Run Code Online (Sandbox Code Playgroud) <mat-vertical-stepper>
<mat-step label="Agreement Preparation">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
<mat-step label="Ready for Biometric" selected active>
<p>Agreement preparion is intiated by our side </p>
</mat-step>
<mat-step label="Document in Submission">
<p>Agreement preparion is intiated by our side </p>
</mat-step>
Run Code Online (Sandbox Code Playgroud)
我尝试设置活动和选择但它不起作用.
我的应用程序中有近 17 个模块,其大小与 Angular 生成的模块相比可以忽略不计。
chunk {common} common.chunk.js (common) 2.18 MB
chunk {main} main.bundle.js (main) 4.42 MB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 616 KB [initial]
Run Code Online (Sandbox Code Playgroud)
我知道 Angular 生成这些块是为了处理一些内部内容,但为什么主包是 4.5 MB。
我究竟做错了什么?
有什么办法可以减小这些尺寸吗?
考虑像这样的JSON
{
"products": {
"c1": {
"stock": 100
},
"c2": {
"stock": 200
},
"c3": {
"stock": 300
},
"c4": {
"stock": 400
},
"c5": {
"stock": 500
}
}
}
Run Code Online (Sandbox Code Playgroud)
为了找到最少的库存,我写了这样的代码
var minStock=Math.min(
products.c1.stock,
products.c2.stock,
products.c3.stock,
products.c4.stock,
products.c5.stock
)
console.log(minStock);
Run Code Online (Sandbox Code Playgroud)
现在我想知道基于库存值的c1,c2,c3,c4或c5是最小的,在这种情况下说
console.log("c1 is minimum with stock 100");
Run Code Online (Sandbox Code Playgroud) 我做了ng add @angular/pwa,我在生产版本中遇到了这个错误
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
at Driver.<anonymous> (ngsw-worker.js:2297)
at Generator.next (<anonymous>)
at fulfilled (ngsw-worker.js:1752)
Run Code Online (Sandbox Code Playgroud)
我做了一些研究,发现/ngsw.json?ngsw-cache-bust=0.08769372894975769GET 请求存在问题
。尽管 fetchLatestManifest 返回 200 状态代码,响应实际上不是 JSON ,而是它的无脚本版本index.html
您可以看到响应状态为 200 /ngsw.json?ngsw-cache-bust=0.08769372894975769

但实际响应不是所需的 JSON

我尝试复制作为 chrome 中的 fetch 选项实际 ```
fetch("https://officehawk.com/ngsw.json?ngsw-cache-bust=0.7927584506157848", {"credentials":"omit","headers":{},"referrer":"https://officehawk.com/ngsw-worker.js","referrerPolicy":"no-referrer-when-downgrade","body":null,"method":"GET","mode":"cors"});
Run Code Online (Sandbox Code Playgroud)
``` 并且我?ngsw-cache-bust=0.7927584506157848从 fetch 的 URL 部分中删除,我可以看到响应是 JSON。
编辑了```
fetch("https://officehawk.com/ngsw.json", {"credentials":"omit","headers":{},"referrer":"https://officehawk.com/ngsw-worker.js","referrerPolicy":"no-referrer-when-downgrade","body":null,"method":"GET","mode":"cors"});
Run Code Online (Sandbox Code Playgroud)
``` 这样你就可以看到 ngsw.json 的内容了

我怀疑它必须在这个函数中处理? https://github.com/angular/angular/blob/0b4d85e9f19246af68a75140afc4db3d97f9ddfd/packages/service-worker/worker/src/driver.ts#L645
角度版本:6.0.0
浏览器: - [x] Chrome(桌面)版本 67