[英]What is the syntax of angular one time binding for multiple properties in ng-if
我有一個
ng-if="dc.emailNotificationSchedule.progressInterval === dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN"
。
我想做的是在ng-if
為兩個變量設置一次綁定。 但是當我嘗試使用
ng-if="(::dc.emailNotificationSchedule.progressInterval) === (::dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)"
角度拋出以下錯誤:
錯誤:[$ parse:syntax]語法錯誤:令牌':'不是表達式[(:: dc.emailNotificationSchedule.progressInterval)===(:: dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)的第2列上的主表達式
[:: dc.emailNotificationSchedule.progressInterval)===
(:: dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)]。
什么是正確的方法?
嘗試這種方式:
ng-if="::(dc.emailNotificationSchedule.progressInterval === dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)"
這應該工作正常:
ng-if="::dc.emailNotificationSchedule.progressInterval == dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN"
您不需要兩次雙冒號
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.