/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Injectable } from '@angular/core';
var FormService = /** @class */ (function () {
    function FormService() {
    }
    /**
     * @param {?} options
     * @return {?}
     */
    FormService.prototype.init = /**
     * @param {?} options
     * @return {?}
     */
    function (options) {
    };
    ;
    // todo: errorHandler
    /**
     * @param {?} error
     * @return {?}
     */
    FormService.prototype.errorHandler = /**
     * @param {?} error
     * @return {?}
     */
    function (error) {
        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')+'.');
        // }
    };
    FormService.decorators = [
        { type: Injectable },
    ];
    /** @nocollapse */
    FormService.ctorParameters = function () { return []; };
    return FormService;
}());
export { FormService };
function FormService_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    FormService.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    FormService.ctorParameters;
    /** @type {?} */
    FormService.prototype.model;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vYXBwLWJhc2UtbGlicmFyeS8iLCJzb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