且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ng-hide/ng-show 中是否可以使用复杂的表达式?

更新时间:2022-02-18 04:02:59

如果您需要运行任意 JavaScript 代码,请使用控制器方法,或者您可以定义返回 true 或 false 的过滤器.

Use a controller method if you need to run arbitrary JavaScript code, or you could define a filter that returned true or false.

我刚刚测试过(应该先完成),并且像 ng-show="!a && b" 之类的东西按预期工作.

I just tested (should have done that first), and something like ng-show="!a && b" worked as expected.