且构网

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

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

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

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.

另请参阅了解 Angular 模板.