我有一个问题,当我在我的HTML Angular应用程序中导航时,当页面呈现时,页面上的所有内容都是“选中的”。
我使用的是最新的Angular 1.x版本,以及Angular材料(最新)。我应该补充说,我是在NWJS 0.12中运行这个的,这可能是一个因素
我还没有确定导致这种情况发生的确切行为模式,但它经常足以让用户感到恼火。
发布于 2016-11-16 22:25:18
我将我的nwjs版本升级到了0.14.7,这个问题就解决了。
发布于 2016-09-22 22:20:19
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>
https://stackoverflow.com/questions/39639766
复制相似问题