Domanda

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

È stato utile?

Soluzione

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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top