Compare ng if in angular [closed]

1

I'm trying to compare

ng-repeat="conversation in vm.conversations" ng-if="conversation=second">

conversation with the value "second"

What is my mistake?

    
asked by deluf 06.06.2017 в 17:50
source

2 answers

3

You must use the comparison operator == and it should be like this:

ng-if="conversation=='second'"

Remember that the value you are looking for is 'second' , it is a text and it should be within quotation marks

    
answered by 06.06.2017 / 17:55
source
3

You should compare this way:

conversation == second

By using a single = you are making an assignment and not a comparison.

I hope it's what you're looking for, otherwise you can ask again as many times as you need.

    
answered by 06.06.2017 в 17:53