Let’s say, I have 5 view modules dependency, and I want to load those module until needed.
I can’t pre-load those dependency as normally do, because the content of the modules will be generated by server based on the value supplied by user. How do I do that?
For example:
`
define([], function() {
var layout = {
view: 'button', value: 'button', click: function() {
require(['views/module1'], function(module) {
//won't work. scope does not recognized
this.$scope.ui(module);
});
}
}
return {
$ui: layout
}
});
`