HTML 页面 Select 所有 Angular 问题还是 NWJS 问题?

HTML Page Select All Angular issue or NWJS issue?

我有一个问题,当我浏览我的 HTML Angular 应用程序时,当页面呈现时它会呈现页面上的所有内容 "selected"。

我使用的是最新的 Angular 1.x 版本,以及 Angular material(最新)。我应该补充一点,我在 NWJS 0.12 中是 运行 这个,这可能是一个因素

我还没有确定导致这种情况发生的确切行为模式,但它通常足以让用户厌烦。

let selector = document.querySelectorAll("h1");

for(let i = 0; i < selector.length; i++){

  let ng = selector[i].getAttribute("ng-model");
  
  if(ng != null){
    console.log(selector[i].classList.add("selected"))
  }
  

}
.selected{
  background: skyblue;
  display: block;
}
<h1>20% Cooler</h1>
<h1 ng-model="cooler">20% Cooler</h1>
<h1 ng-model="cuteOctocat">GitHubr</h1>

我将我的 nwjs 版本升级到 0.14.7,问题消失了。