InterpolateProvider in angularjs 2

╄→гoц情女王★ 提交于 2019-11-28 06:05:22

问题


I'm trying to do something similar to this interpolateProvider in AngularJS 2 but can not find how to do this similarly for

$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');

回答1:


You can pass a CompilerConfig to bootstrapModule where you can configure a regular expression that defines what characters are used for interpolation:

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

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

See also Angular2 setting view encapsulation globally



来源:https://stackoverflow.com/questions/39819407/interpolateprovider-in-angularjs-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!