In AngularJS's ngShow or ngHide, or conditional, what happens when a property doesn't exist? (such as for a.b.c.d or !a.b.c.d)
问题 Let's say in the condition of AngularJS's ngShow , what if a property doesn't exist? For example, if vm.foo is 1 , then what if in the HTML, there is a <div ng-show="myCtrl.foo.bar.wa.la"> hello </div> and what if it is <div ng-show="!myCtrl.foo.bar.wa.la"> hello </div> Example at: https://jsfiddle.net/4yg2ocy6/1/ (If it is pure JavaScript, it will raise an exception) I suspect that myCtrl.foo.bar.wa.la is treated by AngularJS as the same as: (myCtrl.foo && myCtrl.foo.bar && myCtrl.foo.bar.wa