import { Directive, ElementRef, Input, NgZone } from '@angular/core';
import $ from 'jquery';
import 'gridstack/dist/gridstack';
// import 'gridstack/dist/gridstack.min.css';
import './gridstack.jQueryUI';
import 'rxjs/add/operator/first';
var GridStackDirective = (function () {
    function GridStackDirective(_elementRef, _zone) {
        this._elementRef = _elementRef;
        this._zone = _zone;
    }
    GridStackDirective.prototype.ngOnInit = function () {
        var _this = this;
        this._zoneSubscription = this._zone.onMicrotaskEmpty.first().subscribe(function () {
            var elem = $(_this._elementRef.nativeElement);
            elem.addClass('grid-stack');
            _this._grid = elem.gridstack(_this.options);
        });
    };
    GridStackDirective.prototype.ngOnDestroy = function () {
        this._zoneSubscription.unsubscribe();
    };
    return GridStackDirective;
}());
export { GridStackDirective };
GridStackDirective.decorators = [
    { type: Directive, args: [{
                selector: '[grid-stack]'
            },] },
];
/** @nocollapse */
GridStackDirective.ctorParameters = function () { return [
    { type: ElementRef, },
    { type: NgZone, },
]; };
GridStackDirective.propDecorators = {
    'options': [{ type: Input, args: ['grid-stack',] },],
};
//# sourceMappingURL=grid-stack.directive.js.map