且构网

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

AngularJS:ng-show/ng-hide不适用于`{{}}`插值

更新时间:2022-02-15 03:36:52

foo.bar参考不应包含大括号:

The foo.bar reference should not contain the braces:

<p ng-hide="foo.bar">I could be shown, or I could be hidden</p>
<p ng-show="foo.bar">I could be shown, or I could be hidden</p>

Angular 表达式必须位于大括号绑定中,其中Angular

Angular expressions need to be within the curly-brace bindings, where as Angular directives do not.

另请参见了解角度模板.