| /******************************************************************************** |
| * Copyright (c) 2020 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0 |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| ********************************************************************************/ |
| |
| import {Component} from "@angular/core"; |
| import {NgForm} from "@angular/forms"; |
| import {Store} from "@ngrx/store"; |
| import {addNewStatementAction} from "../../../../store/statements/statements.actions"; |
| |
| @Component({ |
| selector: "app-new-statement", |
| templateUrl: "./new-statement.component.html", |
| styleUrls: ["./new-statement.component.scss"] |
| }) |
| export class NewStatementComponent { |
| |
| public title = ""; |
| |
| public dueDate = new Date(); |
| |
| public constructor(private readonly store: Store) { |
| |
| } |
| |
| public submit(form: NgForm) { |
| if (form.valid) { |
| this.store.dispatch(addNewStatementAction(form.value)); |
| } |
| } |
| |
| } |