Store in GIT
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {User} from "../../../classes/user.class";
|
||||
import {DataService} from './../../../services/data.service';
|
||||
|
||||
@Component({
|
||||
selector: 'user-form',
|
||||
templateUrl: './user-form.component.html'
|
||||
})
|
||||
|
||||
export class UserFormComponent {
|
||||
|
||||
constructor(private data: DataService) {
|
||||
}
|
||||
|
||||
temp: string;
|
||||
|
||||
roles = ['Pilot', 'Student', 'Instructor'];
|
||||
|
||||
model = new User(0, "", "", this.roles[0]);
|
||||
|
||||
submitted = false;
|
||||
|
||||
onSubmit() {
|
||||
this.submitted = true;
|
||||
this.data.load().then(() => {
|
||||
this.data.postUser(this.model).subscribe(b => this.temp = JSON.stringify(b));
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user