(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@rxweb/framework'), require('@angular/common')) :
    typeof define === 'function' && define.amd ? define('@rxweb/angular/spinner', ['exports', '@angular/core', '@rxweb/framework', '@angular/common'], factory) :
    (global = global || self, factory((global.rxweb = global.rxweb || {}, global.rxweb.angular = global.rxweb.angular || {}, global.rxweb.angular.spinner = {}), global['@angular/core'], global['@rxweb/framework'], global.ng.common));
}(this, (function (exports, core, framework, common) { 'use strict';

    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var RxSpinnerDirective = /** @class */ (function () {
        function RxSpinnerDirective(elementRef) {
            this.elementRef = elementRef;
            this.element = this.elementRef.nativeElement;
        }
        Object.defineProperty(RxSpinnerDirective.prototype, "spinner", {
            get: function () {
                return this._spinner;
            },
            set: function (value) {
                this._spinner = value;
                if (this.spinnerDirective)
                    this.bind();
            },
            enumerable: true,
            configurable: true
        });
        RxSpinnerDirective.prototype.ngAfterViewInit = function () {
            this.spinnerDirective = framework.instanceResolver("rxSpinner", this.element);
            this.bind();
        };
        RxSpinnerDirective.prototype.bind = function () {
            this.spinnerDirective.valueChange(this._spinner);
        };
        RxSpinnerDirective.prototype.ngOnDestroy = function () {
            this.spinnerDirective.destroy();
        };
        RxSpinnerDirective.ctorParameters = function () { return [
            { type: core.ElementRef }
        ]; };
        __decorate([
            core.Input()
        ], RxSpinnerDirective.prototype, "componentId", void 0);
        __decorate([
            core.Input('rxSpinner')
        ], RxSpinnerDirective.prototype, "spinner", null);
        RxSpinnerDirective = __decorate([
            core.Directive({
                selector: '[rxSpinner]',
            })
        ], RxSpinnerDirective);
        return RxSpinnerDirective;
    }());
    var RxSpinnerModule = /** @class */ (function () {
        function RxSpinnerModule() {
        }
        RxSpinnerModule = __decorate([
            core.NgModule({
                imports: [common.CommonModule],
                exports: [RxSpinnerDirective],
                declarations: [RxSpinnerDirective]
            })
        ], RxSpinnerModule);
        return RxSpinnerModule;
    }());

    exports.RxSpinnerDirective = RxSpinnerDirective;
    exports.RxSpinnerModule = RxSpinnerModule;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=rxweb-angular-spinner.umd.js.map
