Using Underscore Template with Knockout using interpolate due to asp.net

前端 未结 3 1914
闹比i
闹比i 2020-12-20 00:53

Issue

I need to use the underscore template instead of the default KnockoutJS template engine due to performance. However, since I\'m in an asp.net environment th

3条回答
  •  一个人的身影
    2020-12-20 01:53

    The _.templateSettings configuration is global, so just add the block

    _.templateSettings = {
        interpolate : /\{\{(.+?)\}\}/g
    };
    

    anywhere earlier in your code.

提交回复
热议问题