Skip to content

Instantly share code, notes, and snippets.

@saurabhpati
Created June 11, 2018 05:14
Show Gist options
  • Save saurabhpati/2921d9762d1a0d2f0a86aa720ec11566 to your computer and use it in GitHub Desktop.
Save saurabhpati/2921d9762d1a0d2f0a86aa720ec11566 to your computer and use it in GitHub Desktop.
This is a suspiciousService
function suspiciousService($q) {
this.doVeryImportantStuff = function (options) {
if (options.throwException) {
throw 'An exception thrown as per required options.'
}
return $q.resolve({ data: 'Data without exception.' });
}
}
suspiciousService.$inject = ['$q'];
angular
.module('demoModule')
.service('suspiciousService', suspiciousService);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment