4
What is the most efficient way to solve the conflict problem between Django and Angularjs when using {{ }}
in the templates?
4
What is the most efficient way to solve the conflict problem between Django and Angularjs when using {{ }}
in the templates?
4
Angularjs provides tools for setting markers via $interpolateProvider
. For example, if you want to use [[
and ]]
as markers, use the following snippet:
var myApp = angular.module('myApp', [], function($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
});
Source of the snippet: https://stackoverflow.com/questions/12923521/angular-js-custom-delimiter
Just watch out for the symbols you use as markers, so you don’t create something like this: <span>[[array[myIndex]]]</span>
(in a line already gets strange, imagine in several).
@Correct Fernando - in theory you can use any combination, including some that are only partial changes such as {*
and *}
.
Browser other questions tagged angularjs django
You are not signed in. Login or sign up in order to post.
The only way is to change the source code of one of the two, so that for example Angular recognizes
[[ ]]
and Django{{ }}
.– Vinícius Gobbo A. de Oliveira