Hi,
Thanks for answer,
http://requirejs.org/ is just a loader, i like to user for load external templates html and use with any javascript template engine like: doT, jquery template, etc... Normally requirejs need tha the library export their symbols, like i did on post before. I try do this but not work, because requirejs and puremvc both has a define method and i was making a change inside puremvc namespace, it generate the problem.
1 - But a try load diferente way, i just declare a requirejs module in file
puremvc-wrap.js, like this:
define([lib/puremvc/puremvc-1.0.1],function(){
return window.puremvc;
});
2 - And to use new puremvc module in
main.js file, i did this:
require.config({
puremvc:'libs/puremvc/puremvc-wrap'
});
3 - To use new puremvc module declaring my application facade in
applicationFacade.js file, i did this:
define(['puremvc'],function(puremvc){
return puremvc.define(
{
name: demo.ApplicationFacade
parent: puremvc.Facade
},
{
startup:function(){
if(!this.initialized)
this.initialized = true;
}
},
{
getInstance:function(multitonKey){
var instanceMap = puremvc.Facade.instanceMap;
instance = instanceMap[multitonKey];
if(instance)
return instance;
return instanceMap[multitonKey] = new demo.ApplicationFacade(multitonKey);
},
NAME:'demo'
}
);
});
5 - To use declared facade i back to
main.js file, and i did this:
define(['applicationFacade'],function(demo){
demo.ApplicationFacade.getInstance(demo.ApplicationFacade.NAME).startup();
});
All work nicely, thank you for answer, sorry for the misundertanding. keep up with greate work.