InterpolateProvider in angularjs 2

I am trying to do something similar to this interpolateProvider in AngularJS 2, but cannot find how to do it the same way for

$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
+2
source share
1 answer

You can pass CompilerConfigin bootstrapModule, where you can set up a regular expression that determines which characters are used for interpolation:

var INTERPOLATION_REGEXP = /\{\{([\s\S]*?)\}\}/g; // default

platformBrowserDynamic().bootstrapModule(AppModule, [
    {
        interpolationRegexp: INTERPOLATION_REGEXP
    }
]);

See also Angular2 encapsulation of incremental representations around the world.

+2
source

Source: https://habr.com/ru/post/1667138/


All Articles