Created
December 20, 2014 19:09
-
-
Save devdays/7b20ee1c9454af07bc86 to your computer and use it in GitHub Desktop.
Object JavaScript - Calling the Module
This file contains 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
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