Last Updated: February 25, 2016
·
2.095K
· beshrkayali

AngularJS and Django Interpolators

Django and AngularJS use the double curly brackets (these {{ }}</code>) in their templating language as .

Fortunately, there's an easy fix for that. If you're using Angular 1.0 or later you can use the $interpolateProvider APIs to modify these symbols:

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

<small>I found out that using this form "{[" and "]}" is better than "{[{" and "}]}". It's nothing technical, just a personal preference.</small>

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

AngularJS pages are long-lived browser apps with the same script risk as a newer single-page app. Third-party code in the template can read forms and values rendered on the page.

Security insights from Cside