E
E
Ernest Faizullin2015-12-13 21:59:17
JavaScript
Ernest Faizullin, 2015-12-13 21:59:17

How to tell html page not to read code with curly braces until angular starts parsing them?

Pictures are displayed in ng-repeat

...
  <li ng-repeat="course in courses.items" ng-cloak>
    <img src="@{{ course.org_logo }}"  title="@{{ course.title }}">
  </li>
...

The first time the page is loaded, the html tries to open the image, but angular hasn't parsed yet, and the src attribute has a link with curly brackets src="@{{ course.org_logo }}" . The result is an error
80e191f6738c4239b015e7d22804e888.jpg
How to make html not try to open the image until angular starts parsing the brackets? The ng-cloak
attribute is already there , and the angular.min.js itself is loaded before the start of the html block

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2015-12-13
@erniesto77

There is a section specifically about this in the documentation.
Use ng-src instead of src for the img tag .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question