Question

How can I compare two scope values using angularjs in HTML only?

for example:

<div ng-if="place.id = place.reference.id"> show if equals</div>

I want this to cover certain scanrios

Was it helpful?

Solution

You are assigning something this way...

To check for equality you need == or ===, but 3 should be used as Doug says -

"If there is every anything that causes unwanted effects and can be solved by something else, use the something else..."

Ok maybe he didnt say that exactly but you get the point....

<div ng-if="place.id === place.reference.id"> show if equals</div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top