gulp 使用 angular 构建在 HTML 中添加活动 class 的引号

gulp build throwing off quotes that add active class in HTML using angular

使用 gulp-angular 自耕农生成器。

我写下这一行是为了设置一个锚点来接收活动 class。

 <a ui-sref='landing.recipe' ng-click="land.select('one')"           
   ng-class="{active: land.selected === 'one'}">Recipe</a>

显然控制器上有一些 javascript,但是当我在本地服务时它工作正常。

问题是,在我 运行 gulp 构建之后它做了这个并且不再起作用,

<a ui-sref="landing.recipe" ng-click="land.select(" one")"="" 
  ng-class="{active: land.selected === " one"}"="" href="#/landing/recipe">Recipe</a>

感谢您帮助我解决这个问题。

将输入从字符串更改为实数以消除引号中的引号,现在效果很好。

预构建,

 <a ui-sref='landing.recipe' ng-click='land.select(1)'               
 ng-class='{active: land.selected === 1}'>Recipe</a>

构建后,

<a ui-sref="landing.recipe" ng-click="land.select(1)" 
ng-class="{active: land.selected === 1}" href="#/landing/recipe" class="active">Recipe</a>

现在一切正常post构建。