I'm having trouble including a module in RequireJS.
There's two files.. test.js and card.js
In test.js, when the page loads it says "undefined is not a function":
require(
['app',
'jquery',
'card'],
function(App, $, Card) {
var card = new Card("test");
}
);
Here is the card.js:
define("Card", function () {
function Card(name) {
this.name = name;
};
return Card;
});
I put some console.log()'s in the card.js and it calls those fine when it's being referenced like that in test.js. Also if I were to define a regular js object class in card.js (e.g.):
function Card(name) {
this.name = name;
}
I am able to create that Card object properly in test.js.
Any clues how I'm hooking it all up wrong?