1

This is how my code looks like:

<a href class="item" ng-repeat="area in subAreas"
    ng-click="house.cityId='{{ area.id }}';house.cityType='{{ area.type }}';loadMainList(house)">
       {{ area.name }}
</a>

But when I click this link on page and it's not working. There's no error message found in console, just no response. I inspected the element in Chrome, and the value passed correctly.

Finally, I tried to use the real values instead of {{...}} syntax, just for standard usage, like this ng-click="house.cityId=area.id;house.cityType=area.type;loadMainList(house)", the miracle happened, it worked. But this makes me confused as well.

Can anyone help explain what's the difference between these two usages? Or is it wrong using {{}} in AngularJS directives? I'm just a beginner in AngualarJS. Thanks in advance.

Sky
  • 7,343
  • 8
  • 31
  • 42

0 Answers0