Last active
August 29, 2015 14:01
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["jquery"], function ($) { | |
"use strict"; | |
var App = function (target) { | |
this.target = target || $("body"); | |
}; | |
App.prototype.start = function () { | |
this.target.html("App Started!"); | |
}; | |
return App; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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