Вопрос

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

Это было полезно?

Решение

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>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top