### File

`projects/app-base-library/src/lib/angular/services/form.service.ts`

### Index

###### Properties

- Public model

###### Methods

- errorHandler
- Public init

### Constructor

`constructor()`
Defined in projects/app-base-library/src/lib/angular/services/form.service.ts:6

### Methods

errorHandler
`errorHandler(error: any)`
Defined in projects/app-base-library/src/lib/angular/services/form.service.ts:15

Parameters :

Name | Type | Optional
error | `any` | no

Returns : `void`

Public init
`init(options: )`
Defined in projects/app-base-library/src/lib/angular/services/form.service.ts:10

Parameters :

Name | Optional
options | no

Returns : `void`

### Properties

Public model
`model: `any``
Type : `any`
Defined in projects/app-base-library/src/lib/angular/services/form.service.ts:6

    import { Injectable, EventEmitter } from '@angular/core';
    // import { Observable } from 'rxjs/Rx';

    @Injectable()
    export class FormService {
      public model: any;

      constructor() { }

      public init(options) {

      };

      // todo: errorHandler
      errorHandler(error: any) {
        console.log(error);
        // AppService.scope.$broadcast('formError', error);
        // if(AppSettings.dev){
        //   console.log(error);
        // }
        // if(!error){
        //   return;
        // }
        // if(error.data === "token expired"){
        //   toastr.warning($filter('translate')('LOGIN EXPIRED')+'.');
        //   service.logOut();
        //   return;
        // }
        // if (error.statusText === 'Bad Request' || error.status == 400) {
        //   if (error.data.message) {
        //     toastr.warning($filter('translate')(error.data.message));
        //   } else {
        //     toastr.warning($filter('translate')('ERROR BAD REQUEST') + '.');
        //   }
        // }
        // if(error.statusText === 'Unauthorized' || error.status == 401){
        //   toastr.warning($filter('translate')('UNAUTHORIZED ERROR')+'.');
        //   service.logOut();
        //   return;
        // }
        // if(error.statusText === 'Not found' || error.status == 404){
        //   toastr.warning($filter('translate')('ERROR NOT FOUND')+'.');
        // }
      }

    }

# results matching ""

# No results matching ""