Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 20, 2014 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/7b20ee1c9454af07bc86 to your computer and use it in GitHub Desktop.
Save devdays/7b20ee1c9454af07bc86 to your computer and use it in GitHub Desktop.
Object JavaScript - Calling the Module
require(['app/sampleQ', 'q'], function (sample, Q) {
// do something with the sample object
sample.count(10, 20).then(function (countResponse) {
console.log("count successful" + countResponse);
});
// catch an error
sample.count(20, 10).then(function (countResponse) {
console.log("count successful" + countResponse);
}).catch(function (error) {
console.log("error in sample: " + error);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment