Skip to content

Instantly share code, notes, and snippets.

@stephen-james
Last active August 29, 2015 14:01
Show Gist options
  • Save stephen-james/69030f42916da98616df to your computer and use it in GitHub Desktop.
Save stephen-james/69030f42916da98616df to your computer and use it in GitHub Desktop.
lab-karam-require-jasmine step 3 - setting up the requireJS bootstrap and app entry point
define(["jquery"], function ($) {
"use strict";
var App = function (target) {
this.target = target || $("body");
};
App.prototype.start = function () {
this.target.html("App Started!");
};
return App;
});
requirejs.config({
urlArgs: 'bustCache=' + (new Date()).getTime(),
paths: {
'jquery': '../node_modules/jquery/dist/jquery'
},
callback: function () {
"use strict";
require(["app"], function (App) {
var app = new App();
app.start();
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment