"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
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 __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require("@angular/core");
var busy_1 = require("../../busy/busy");
var baseButton_1 = require("../baseButton");
var form_1 = require("../../form/form");
var ButtonSubmitComponent = (function (_super) {
    __extends(ButtonSubmitComponent, _super);
    function ButtonSubmitComponent(form) {
        var _this = _super.call(this) || this;
        _this.form = form;
        return _this;
    }
    ButtonSubmitComponent.prototype.submit = function () {
        // subscribes to kick off the action
        var request = this.form.submitAndWait();
        this.busySpinner.waitOn(request).subscribe();
    };
    return ButtonSubmitComponent;
}(baseButton_1.BaseButtonComponent));
__decorate([
    core_1.ViewChild(busy_1.BusyComponent),
    __metadata("design:type", busy_1.BusyComponent)
], ButtonSubmitComponent.prototype, "busySpinner", void 0);
ButtonSubmitComponent = __decorate([
    core_1.Component({
        selector: 'rlButtonSubmit',
        template: require('./buttonSubmit.html'),
        inputs: baseButton_1.baseInputs,
    }),
    __metadata("design:paramtypes", [form_1.FormComponent])
], ButtonSubmitComponent);
exports.ButtonSubmitComponent = ButtonSubmitComponent;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uU3VibWl0LmpzIiwic291cmN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