Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Problem with steal packages

$
0
0
Hello,

I am using JavascriptMVC 3.3 with packages features to load features only when needed.
So I have a control defined in cookbook/recipe/create and I use it as a package in another control:

  1. steal.packages(..., 'cookbook/recipe/create', ...)
  2. .then('can','./init.ejs', 
  3.         'cookbook/models/recipe/recipe.js',
  4.         function(can, initView, 
  5.                 Recipe){

  6.     return can.Control(
  7. /** @Static */
  8. {
  9.             defaults : {
  10.                 Recipe: Recipe
  11.             }
  12. },
  13. /** @Prototype */
  14. {
  15.             init : function(){
  16.                 this.element.html(initView({}));
  17.             },
  18.             ...
  19.             "{Recipe} create": function(){
  20.                 steal('cookbook/recipe/create', function(RecipeCreate){
  21.                     new RecipeCreate('#recipeForm');
  22.                 });
  23.             },
  24.             ...
  25. });
  26. });

If I run that in dev mode, it work fine, but if i run in production mode, RecipeCreate, at line 21 is undefined, thus the control create cannot be built at line 22.

Anyone has an idea how I could build the create control?

Sandrine.



Viewing all articles
Browse latest Browse all 3491

Trending Articles