+
New Flight
+
{{ flight.allEmailsSent ? 'Sent' : 'Sending' }} emails to all users... [ {{ flight.sentEmails }} ]
+
+
+
+
diff --git a/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/manage-flights/manage-flights.component.ts b/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/manage-flights/manage-flights.component.ts
new file mode 100644
index 0000000..228d451
--- /dev/null
+++ b/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/manage-flights/manage-flights.component.ts
@@ -0,0 +1,42 @@
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {Airplane} from "../../models/airplane";
+import {AirplaneService} from "../../services/airplane.service";
+import {FlightsService} from "../../services/flights.service";
+import {NgForm} from "@angular/forms";
+import {Flight} from "../../models/flight";
+import {interval} from "rxjs/internal/observable/interval";
+
+@Component({
+ selector: 'app-manage-flights',
+ templateUrl: './manage-flights.component.html',
+ styleUrls: ['./manage-flights.component.css']
+})
+export class ManageFlightsComponent implements OnInit {
+ @ViewChild('flightForm') flightForm: NgForm;
+ airplanes: Airplane[] = [];
+ flight: Flight = null;
+
+ constructor(private airplaneService: AirplaneService,
+ private flightService: FlightsService) { }
+
+ ngOnInit() {
+ this.airplaneService.getAll((result: Airplane[]) => this.airplanes = result);
+ }
+
+ createFlight() {
+ this.flightService.create(this.flightForm.value, (flight: Flight) => {
+ this.flightService.notify(flight.id);
+ debugger
+
+ this.flight = flight;
+ const interval = setInterval(() => {
+ if(this.flight.allEmailsSent) {
+ clearInterval(interval);
+ return;
+ }
+
+ this.flightService.getOne(flight.id, (flight: Flight) => this.flight = flight);
+ }, 1000);
+ });
+ }
+}
diff --git a/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/navbar/nav-link/nav-link.component.css b/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/navbar/nav-link/nav-link.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/navbar/nav-link/nav-link.component.html b/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/navbar/nav-link/nav-link.component.html
new file mode 100644
index 0000000..6c2fea6
--- /dev/null
+++ b/POPESCU_ALEXANDRU/Proiect/Flights/client/src/app/components/navbar/nav-link/nav-link.component.html
@@ -0,0 +1,3 @@
+