how to load precomplied template in backbone?

后端 未结 1 1619
情话喂你
情话喂你 2021-01-27 17:52

could you please tell me how to load precomplied templates .I googled it and find a solution .Now I don\'t know how to use this function.could you please tell me how to use this

相关标签:
1条回答
  • 2021-01-27 18:36

    The code that you are trying to use, replaces default HTML mechanism in Marionette.

    1. 'template/test.html' will be translated to "/app/templates/template/test.html.html", which I guess is not what you want (Either change url generation, or template pointer)
    2. Your Backbone code, does not assume, that "test.html" was precompiled on contrary compilation is happening on the client, following GET response, is this what you want?
    3. Regarding Backbone override use, it should be called before you try to render your ToolItemView, so basically you can call this code anywhere before ToolItemView render.
    0 讨论(0)
提交回复
热议问题