0
我用ng-repeat列出了一些图像,并且想要应用一个带有一些内容的伪类。CSS伪元素不适用于ng-repeat?
这里是我的小提琴:https://jsfiddle.net/Noitidart/y7dxa6n8/11/
这里是代码:
<style>
body {background-color:steelblue;}
img::after { content: 'rawr'; size:100px; color:red; }
</style>
<div ng-app="myApp">
<div ng-controller="MyController as mc">
<img ng-repeat="aSrc in mc.arr" ng-src="{{aSrc}}"/>
</div>
</div>
控制器:
var myApp = angular.module('myApp', ['ngCookies']);
myApp.controller('MyController', [function($cookie) {
this.arr = ['https://jsfiddle.net/img/logo.png']
}]);
但是伪类无法正常工作。这很奇怪。
Wowwwww我用这块垃圾挣扎了一个半小时,然后吃了一顿晚餐。谢谢你,你救了我这么头疼! – Noitidart
啊:)很高兴听到那cheerz :) –