1

I am new in angularjs, I am getting employment status and i just want if i am getting employement status equal to HALFTIME then PartTime text should be display,Here is my code but not working,showing me nothing,where i am wrong ?

<h2 ng-if="{{myprofile.myJobs[0].employmentType}}==HALFTIME"> Part Time </h2> 
2
  • Enclose HALFTIME in quotes. Commented Jul 10, 2019 at 11:23
  • 2
    You don't use {{}} interpolation in ng-if. And is HALTIME a scope variable or is it supposed to be string? Commented Jul 10, 2019 at 11:23

2 Answers 2

4

This is the correct syntax:

<h2 ng-if="myprofile.myJobs[0].employmentType == 'HALFTIME'"> Part Time </h2> 

You don't need curly braces inside ng-if

Sign up to request clarification or add additional context in comments.

Comments

2

You don't have to use interpolation {{ var }}.

<h2 ng-if="myprofile.myJobs[0].employmentType == HALFTIME "> Part Time </h2> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.