"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 __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 movie_1 = require("./movie");
var movie_service_1 = require("./movie.service");
var EditMovieComponent = (function () {
    function EditMovieComponent(movieService) {
        this.movieService = movieService;
        this.movies = [];
        this.notifyParent = new core_1.EventEmitter();
    }
    EditMovieComponent.prototype.sendNotification = function () {
        this.notifyParent.emit(null);
    };
    EditMovieComponent.prototype.ngOnChanges = function () {
        if (this.editModel != null && this.editModel != undefined) {
            var temp = new movie_1.Movie();
            temp.create(this.editModel);
            this.editModel = temp;
        }
    };
    EditMovieComponent.prototype.onSubmit = function () {
        this.movieService.update(this.editModel);
        this.notifyParent.emit(null);
    };
    return EditMovieComponent;
}());
__decorate([
    core_1.Input(),
    __metadata("design:type", movie_1.Movie)
], EditMovieComponent.prototype, "editModel", void 0);
__decorate([
    core_1.Output(),
    __metadata("design:type", core_1.EventEmitter)
], EditMovieComponent.prototype, "notifyParent", void 0);
EditMovieComponent = __decorate([
    core_1.Component({
        selector: 'edit-movie',
        templateUrl: './templates/edit-movie.component.html',
        styleUrls: ['./css/edit-movie.component.css']
    }),
    __metadata("design:paramtypes", [movie_service_1.MovieService])
], EditMovieComponent);
exports.EditMovieComponent = EditMovieComponent;
//# sourceMappingURL=edit-movie.component.js.map