Steve
Steve

Reputation: 2588

Conditional showing in Angular + ionic: Show if Id has specific value

I am trying to show a block in Angular only if ID is of specific value.

I tried this in the following code ng-if="{{what.nid}} === 12", but it didn't work.

This is what I tried:-

 <ng-map zoom="11" center="[40.74, -74.18]" ng-if="{{what.nid}} === 12">
      <marker position="[40.74, -74.18]" />
      <shape name="circle" radius="400" center="[40.74,-74.18]" radius="4000" />
      <control name="overviewMap" opened="true" />
  </ng-map>

Upvotes: 0

Views: 280

Answers (1)

Andr&#233;s Esguerra
Andr&#233;s Esguerra

Reputation: 861

ng-if accepts an expression, so using {{}} inside of it is not necessary, just use ng-if="what.nid === 12"

Upvotes: 2

Related Questions