如何在div中使用ng-style:after?

问题描述 投票:0回答:1

我正在使用Angular 1.x.

这是jsfiddle上的code example

如果qazxsw poi我不想显示qazxsw poi否则(qazxsw poi)我想激活ctrl.shouldShowDiv2 = false。有没有办法让它与div2或任何其他指令一起使用?

ctrl.shouldShowDiv2 = true看起来与我想要的相似但我无法理解。

谢谢。

html css angularjs angular-directive
1个回答
2
投票

你可以做的是创建一个单独的类,你使用box::after选择器。然后使用ng-style切换该类。这是一个例子:

This answer
::after
ctrl.shouldShowDiv2
© www.soinside.com 2019 - 2024. All rights reserved.