Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onSubmit() {
- const fd = new FormData();
- fd.append('resume', this.chosenFile);
- const data = this.contactForm.value;
- data['resume'] = fd;
- console.log(data);
- this.loading = true;
- this.data.createJobEnquiry(data).subscribe((res)=>{
- this.loading = false;
- },(err)=>{
- this.loading = false;
- console.log(err)
- alert("Something went wrong");
- });
- }
- onSubmit() {
- const fd = new FormData();
- fd.append('resume', this.chosenFile);
- const data = this.contactForm.value;
- data['resume'] = fd;
- console.log(data);
- this.loading = true;
- this.data.createJobEnquiry(fd).subscribe((res)=>{
- this.loading = false;
- },(err)=>{
- this.loading = false;
- console.log(err)
- alert("Something went wrong");
- });
- }
- <input formControlName="resume" type="file" id="real-file" (change)="onFileSelected($event)" style="display: none;">
- onFileSelected(event) {
- this.chosenFile = <File>event.target.files[0];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement