"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 static_1 = require("@angular/upgrade/static");
var angular = require("angular");
exports.moduleName = 'FormTestModule';
var FormTestController = (function () {
    function FormTestController($q, $timeout) {
        this.$q = $q;
        this.$timeout = $timeout;
    }
    FormTestController.prototype.$onInit = function () {
        var _this = this;
        this.validator = {
            validate: function () { return _this.text === 'valid'; },
            errorMessage: 'String must be valid',
        };
    };
    FormTestController.prototype.submit = function () {
        return this.$timeout(function () { return console.log('Submitted'); }, 1000);
    };
    FormTestController.prototype.save = function () {
        this.count++;
        return this.$q.when();
    };
    return FormTestController;
}());
FormTestController.$inject = ['$q', '$timeout'];
var FormsNg1BootstrapperComponent = (function () {
    function FormsNg1BootstrapperComponent() {
    }
    return FormsNg1BootstrapperComponent;
}());
FormsNg1BootstrapperComponent = __decorate([
    core_1.Component({
        selector: 'tsFormsNg1Bootstrapper',
        template: '<tsFormsNg1></tsFormsNg1>'
    })
], FormsNg1BootstrapperComponent);
exports.FormsNg1BootstrapperComponent = FormsNg1BootstrapperComponent;
var FormsNg1Directive = (function (_super) {
    __extends(FormsNg1Directive, _super);
    function FormsNg1Directive(elementRef, injector) {
        return _super.call(this, 'tsFormsNg1', elementRef, injector) || this;
    }
    return FormsNg1Directive;
}(static_1.UpgradeComponent));
FormsNg1Directive = __decorate([
    core_1.Directive({
        selector: 'tsFormsNg1'
    }),
    __metadata("design:paramtypes", [core_1.ElementRef, core_1.Injector])
], FormsNg1Directive);
exports.FormsNg1Directive = FormsNg1Directive;
angular.module(exports.moduleName, [])
    .component('tsFormsNg1', {
    template: require('./formsNg1.html'),
    controller: 'FormTestController',
    controllerAs: 'forms',
})
    .controller('FormTestController', FormTestController);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybXNCb290c3RyYXBwZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJmb3Jtc0Jvb3RzdHJhcHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7QUFBQSxzQ0FBMkU7QUFDM0Usa0RBQTJEO0FBQzNELGlDQUFtQztBQUt0QixRQUFBLFVBQVUsR0FBVyxnQkFBZ0IsQ0FBQztBQUVuRDtJQU1DLDRCQUFvQixFQUFxQixFQUFVLFFBQWlDO1FBQWhFLE9BQUUsR0FBRixFQUFFLENBQW1CO1FBQVUsYUFBUSxHQUFSLFFBQVEsQ0FBeUI7SUFBRyxDQUFDO0lBRXhGLG9DQUFPLEdBQVA7UUFBQSxpQkFLQztRQUpBLElBQUksQ0FBQyxTQUFTLEdBQUc7WUFDaEIsUUFBUSxFQUFFLGNBQU0sT0FBQSxLQUFJLENBQUMsSUFBSSxLQUFLLE9BQU8sRUFBckIsQ0FBcUI7WUFDckMsWUFBWSxFQUFFLHNCQUFzQjtTQUNwQyxDQUFDO0lBQ0gsQ0FBQztJQUVELG1DQUFNLEdBQU47UUFDQyxNQUFNLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxjQUFZLE9BQUEsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsRUFBeEIs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