0

Showing AngularJS expression in DOM instead of value in chrome browser but it showing correct value in Firefox.

In Chrome it shows like:

<div id="{profile.id}" data-id="{{profile.id}}">Some Text</div>

In Firefox it displays correctly:

<div id="1234" data-id="1234">Some Text</div>

How do I solve this for Chrome?

Cerbrus
  • 70,800
  • 18
  • 132
  • 147
  • 1
    What's the contents of your html file? (For that line) – Cerbrus Apr 25 '16 at 07:32
  • Try Ctrl + Shift + R for Chrome to clear the cache? – Hoàng Long Apr 25 '16 at 07:36
  • obviously angular doesn't load in your chrome. make sure its loaded. another possibility is that you have many dom elements with the same id. Are you sure the id="1234" is unique to that element? Chrome could get the last one, firefox the first one and make a mess – Sharky Apr 25 '16 at 07:37
  • You can use ng-attr-id in place of id to set id dynamically . http://stackoverflow.com/questions/23655009/how-to-set-the-id-attribute-of-a-html-element-dynamically-with-angular-js . – tirthbal Apr 25 '16 at 08:04

0 Answers0