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

Re : Working with requirejs

$
0
0
Just a heads up, I get this:

Uncaught ReferenceError: jQuery is not defined can.custom.js:417
Uncaught TypeError: Cannot call method 'extend' of undefined 

            return can;
#417:    })(jQuery, __m5, __m6, __m7, __m8);

and my config is:

  1. require.config({
  2.   baseUrl: '../images/js/mn',
  3.   paths: {
  4.     jquery: 'libs/jquery-1.11.0',
  5.     can: 'libs/can.custom'
  6.   }
  7. });

  8. require(['jquery', 'can', 'modules/base'], function($, can, base) {
  9.   new base('body', {
  10.     tpl: 'tpls/pages/h.mustache'
  11.   })
  12. });

  13. // Module file is

  14. define(['jquery', 'can'], function() { 
  15.   return can.Control.extend({
  16.     init: function(element, options) {
  17.       var frag = can.view(options.tpl, options.viewData || {});
  18.       element.html(frag);
  19.     }
  20.   });
  21. });



Viewing all articles
Browse latest Browse all 3491

Trending Articles