https://github.com/angular-modules/angular-service-error-parser
https://github.com/angular-modules/angular-service-error-parser
angular error-parser
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/angular-modules/angular-service-error-parser
- Owner: angular-modules
- License: unlicense
- Created: 2016-07-29T08:04:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-17T07:16:13.000Z (over 9 years ago)
- Last Synced: 2026-01-23T05:58:34.083Z (5 months ago)
- Topics: angular, error-parser
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Install
- Via npm
```
npm install angular-service-error-parser --save
```
- Via bower
```
bower install angular-service-error-parser --save
```
## Usage
jade part:
```
script(src="#{cdn.normal}/libs/angular/angular.min.js?#{cdn.version}")
script(src="#{cdn.normal}/libs/angular-translate/angular-translate.min.js?#{cdn.version}")
script(type="text/javascript", src="#{cdn.normal}/libs/angular-service-error-parser/dist/all.min.js?#{cdn.version}")
```
js part:
```
angular.module('yourModule', ['errorParserModule', 'servicesModule'])
.controller('yourCtrl', ['$scope', 'serviceErrorParser', function($scope, serviceErrorParser, service){
service.post('http://your/service', {})
.catch(function(reason){
$scope.errorMessage = serviceErrorParser.getErrorMessage(reason);
}
;
})
;
```