angular cli不会监视新的环境文件吗?

时间:2018-08-24 10:53:53

标签: angular angular-cli angular6 angular-cli-v6

摘要:我添加了features.forEach(function(feature) { var infowindow = new google.maps.InfoWindow({ content: "Add your popup content here" }); var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat,long), icon: "image.png", /*icon: icons[feature.type].icon,*/ title: "Title for marker", map: map }); marker.addListener('click', function() { infowindow.open(map, marker); }); });,并且能够正确使用environment.local.ts但角度cli不会监视ng serve -c local 中的变化。我该如何监视environment.local.ts中的变化?


我正在使用Angular 6.0.6

我遵循此angular cli wiki加载了另一个环境文件。

我创建了environment.local.ts,并将相关信息添加到src\environments\environment.local.ts中。

angular.json

      "configurations": {
        "production": {
           ...
        },
        "local": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.local.ts"
            }
          ]
        }
      }

"serve": { ... "configurations": { "production": { ... }, "local": { "browserTarget": "frontend:build:local" } } }, 命令正确加载了ng serve -c local,但服务不会监视environment.local.ts中的更改。

我该如何监视environment.local.ts中的变化?

0 个答案:

没有答案