I need to replace special keys in template which I download manually in angular before compiling and inserting into the DOM. Probably angular should have internally such functionallity, so I don't wanna use any 3rd party libraries.
Example:
$http.get('app/components/shapes/box.html', {cache: $templateCache}).then(function (response) {
var template = response.data;
template = template
.replace(/\{\{number\}\}/gm, number)
.replace(/(\r\n|\n|\r)/gm, '');
});
}
I can easily change key from {{$key}} to something else, but I assume angular should have internal functionality to do such manipulations.
For example:
var newTemplate = angular.funcWhichINeed(template, {
varA: value1,
varB: value2
});