0

I'm creating an app with AngularJS and Symfony with Twig. When I use ng-repeat like that:

<div ng-repeat="person in people">
  <img src="{{ '{{ person.photo }}' }}"/>
</div>  

in the browsers console I always get error that resource {{ person.photo }} not found. I believe it makes the page loading time longer and also it doesn't look good when console is full of errors. How do I solve this?

Einius
  • 1,352
  • 2
  • 20
  • 45
  • 2
    dont forget `{% verbatim %}` so twig is not interpreting the lines – john Smith Jun 15 '15 at 11:45
  • I use additional `{{ '` and `'}}` to display twig variables so I don't need to use `{% verbatim %}`. Anyway checked if that makes any difference, but unfortunately it doesn't – Einius Jun 15 '15 at 12:16
  • Some help here : http://stackoverflow.com/questions/10834390/angularjs-on-a-symfony2-application – Perroin Thibault Jun 16 '15 at 13:38

1 Answers1

0

You can also change default start/end tags in AngularJS like below:

$interpolateProvider.startSymbol('{[{').endSymbol('}]}');
Jakub Maj
  • 531
  • 2
  • 6
  • 12