Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
ngIf with as as syntax and && operator

How can I combine the ngIf as syntax with a && operator? The following code results in an "Expected identifier or keyword" error

 <control-error *ngIf="(createUserError | async as userError) && submitted">
          {{userError}}
 </control-error>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

as syntax is applied only to the whole *ngIf expression.

So, this is the valid syntax:

*ngIf="(createUserError | async) && submitted as userError"

which will either hide that block or render true.

But in order to make it right and logicaly correct you can change the order:

*ngIf="submitted && (createUserError | async) as userError"

which should result in the right value for userError variable.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!