簡體   English   中英

ng-if中多個屬性的角度一次性綁定的語法是什么

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM