首页 > 解决方案 > 使用 Angular PWA 时地图函数语法已更改

问题描述

我在 app.component.ts 文件中写了下面的 map 函数,以便在 angular pwa 中构建

function(doc:any) {

              emit(doc.timestamp,doc.news)
            
          }

function(doc:any) {
            if(doc.upVote >= 7 ){
              emit(doc.upVote,doc.news)
            }

如果我使用 pwa 进行构建ng builld --prod,则编译上述文件并生成名为 main.js 的新文件

在 manifest.js 中,map 函数编译如下,所以我无法执行代码

function(s){(void 0)(s.timestamp,s.news)}

function(o){o.upVote>=7&&(void 0)(o.upVote,o.news)}

标签: progressive-web-appsangular-pwa

解决方案


推荐阅读