javascript - Can I override a method in a JSPM package? -


i'm migrating project use jspm & systemjs. in app, override backbone marionette render method use mustache templates:

marionette.renderer.render = function (template, data) {      return mustache.render(template, { model: data }, partials); } 

this simple in old world - have above code after marionette js , mustache js have been added page. can't see how override when i'm loading module though.

import * marionette "backbone.marionette"; 

if problem loading order can, instance, create new (i.e. custom) marionette module depends both on backbone.marionette , mustache , extends marionette. like

import marionette 'backbone.marionette'; import mustache 'moustache';  marionette.renderer.render = function (template, data) {  return mustache.render(template, { model: data }, partials); }  export default marionette; 

after that, you'll need map custom module on systemjs config:

system.config({    'map': {       'custom-marionette': 'path/to/source/custom-marionette',    ...    } } 

then you'll able import custom module inside application:

import marionette 'custom-marionette'; 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -