javascript - RequireJS: Load module from other context -
i have 2 require configurations (two context) this:
var requireportal = require.config({ context: 'portal', baseurl: '', paths: { 'jquery': 'assets/js-vendors/jquery/dist/jquery', 'underscore': 'assets/js-vendors/underscore/underscore', 'backbone': 'assets/js-vendors/backbone/backbone', // ... } }); var requiresample = require.config({ context: 'sample', baseurl: '<adress>/other-context', paths: { 'viewfactory': 'application/util/viewfactory', 'indicador': 'application/models/indicador' } });
here portal context have vendors components, , sample context have utilize case modules. must load vendor components sample context that:
define([ 'indicador' ], function(indicadormodel) { var indicadorpagercollection = pagercollection.extend({ model: indicadormodel, baseurl: 'rest/manter/indicadores' }); homecoming indicadorpagercollection; });
in case, pagercollection
vendor component , in portal context. how can this?
javascript requirejs
No comments:
Post a Comment