0

I am buiding an app using angular and django. So now out of the partials, the code clashes beacause of {{}} .

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

This changes interpolate symbol for whole app but i want to change $interpolate only for specific controller. Can somebody show the way to achieve this?

Ajeet Lakhani
  • 3,768
  • 2
  • 22
  • 37
  • there is no way to change the interpolation for a single controller, short of putting that controller in it's own module. – Claies Apr 11 '15 at 17:36
  • so does that mean i have to change my whole code according to new interpolate symbols? – Ajeet Lakhani Apr 11 '15 at 17:47
  • interpolation isn't the responsibility of a *controller*, it happens before the controllers are even instantiated. Unless you provide a bit more code illustrating your actual issue, the assumption is that you mean you have an HTML template which you want to use django expressions and the expressions from a controller both at the same time. Not only is this generally a bad practice, it's also definitely not possible to selectively handle interpolation differently in that manner. – Claies Apr 11 '15 at 18:08
  • possible duplicate of [AngularJS with Django - Conflicting template tags](http://stackoverflow.com/questions/8302928/angularjs-with-django-conflicting-template-tags) – Paul Sweatte Sep 11 '15 at 18:20

0 Answers0