Suren Aznauryan
Suren Aznauryan

Reputation: 1094

What is the syntax of angular one time binding for multiple properties in ng-if

I have an

ng-if="dc.emailNotificationSchedule.progressInterval === dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN".

What i want to do is to have one time bindings for both variables in ng-if. But when i try to use

ng-if="(::dc.emailNotificationSchedule.progressInterval) === (::dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)"

angular throws the following error :

Error: [$parse:syntax] Syntax Error: Token ':' not a primary expression at column 2 of the expression [(::dc.emailNotificationSchedule.progressInterval) === (::dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)] starting at
[::dc.emailNotificationSchedule.progressInterval) ===
(::dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)].

What is the right way ?

Upvotes: 2

Views: 739

Answers (2)

karaxuna
karaxuna

Reputation: 26930

Try this way:

ng-if="::(dc.emailNotificationSchedule.progressInterval === dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN)"

Upvotes: 2

Przemek
Przemek

Reputation: 803

this should works fine:

ng-if="::dc.emailNotificationSchedule.progressInterval == dc.SkillCompletionProgressIntervals.NEVER_LOGGED_IN"

You don't need double colon twice

Upvotes: 1

Related Questions