0

Want to know if there's some best practices around the use of both together.

There's a conflict with the use of {{ }} for example.

People talk about interpolate:

angular.module('app', []).config(function($interpolateProvider){
  $interpolateProvider.startSymbol('{[{').endSymbol('}]}');
});

Is it the best way? Are there more tips on other use cases?

Thanks you guys!

RPichioli
  • 3,245
  • 2
  • 25
  • 29
  • 1
    Hi, I don't know of any best practices but at my company we are using the "standard" syntax it's a bit ugly but with code-highlighting it works fine. – gries Aug 31 '16 at 14:50
  • Hmm didn't know it works, sounds good! Thanks for the comment – RPichioli Aug 31 '16 at 15:00
  • 1
    Your solution is the way to go @RodrigoQuiñonesPichioli. Use whatever symbol suits to you. Just my 2 cents : Mixing client-side and server-side templating may be a bad practice. So I would choose one of the two. For example, if you are building a rich web application, use Angular template mechanisms and use only Twig ones for specific cases. This way you could maybe keep the origin AngularJS interpolation symbols. – Neozaru Aug 31 '16 at 15:04
  • I understand and agree with you on your explanation, it really depends on the purpose and architecture of each project. Thanks for the comment @Neozaru, I appreciate that – RPichioli Aug 31 '16 at 15:18
  • 2
    Possible duplicate of [AngularJS-Twig conflict with double curly braces](http://stackoverflow.com/questions/13671701/angularjs-twig-conflict-with-double-curly-braces) – Sam Dufel Aug 31 '16 at 15:32
  • 2
    use symfony as a backend and angular as a front end... they should be seperated – NDM Aug 31 '16 at 15:33
  • I'm talking about practices, I just mentioned the interpolation as an example @Dam Dufel – RPichioli Aug 31 '16 at 15:38
  • Ok, that's a good point @NDM, thanks for the explanation – RPichioli Aug 31 '16 at 15:39

0 Answers0