diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-service/consultant.service.ts b/ng-seed/src/app/appoinment/consultant-setting/consultant-service/consultant.service.ts index 31f3c68..16e0ad3 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-service/consultant.service.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-service/consultant.service.ts @@ -1,14 +1,16 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { environment } from 'environments/environment'; -import { Observable } from 'rxjs'; +import { BehaviorSubject, Observable } from 'rxjs'; import { catchError } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) export class ConsultantService { - + public getPractitionerInfo:BehaviorSubject = new BehaviorSubject([]); + public getPractitionerInfo_observable$ = this.getPractitionerInfo.asObservable(); + private apiUrl = environment.apiEndpoint; constructor(private _http: HttpClient) { } @@ -31,6 +33,10 @@ export class ConsultantService { createDurationFeesDetails(params): Observable{ return this._http.post(this.apiUrl + 'CreateDuration', params) } + createPractitionerInfo(param): Observable{ + return this._http.post(this.apiUrl + 'createPractitionerInfo', param) + } + handleError(arg0: string, arg1: undefined[]): (err: any, caught: Observable) => import("rxjs").ObservableInput { throw new Error('Method not implemented.'); diff --git a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html index 2b8044b..2c19276 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html +++ b/ng-seed/src/app/appoinment/consultant-setting/consultant-setting/consultant-setting.component.html @@ -172,116 +172,123 @@ -->
- + Sunday
-
-
- 09:00am +
+
+ {{item.startTime}} +
-
- 06:00pm + {{item.endTime}}
- + Monday
-
-
- 09:00am +
+
+ {{item.startTime}} +
-
- 06:00pm + {{item.endTime}}
-
+
- + Tuesday
-
-
- 09:00am +
+
+ {{item.startTime}} +
-
- 06:00pm + {{item.endTime}}
-
+
- + Wednesday
-
-
- 09:00am +
+
+ {{item.startTime}} +
-
- 06:00pm + {{item.endTime}}
-
-
+

+
- + Thursday
-
-
- 09:00am +
+
+ {{item.startTime}} +
-
- 06:00pm + {{item.endTime}}
-
+
- + Friday
-
-
- 09:00am +
+
+ {{item.startTime}} +
-
- 06:00pm + {{item.endTime}}
-
+
- + Saturday
-
-
- 09:00am +
+
+ {{item.startTime}} +
-
- 06:00pm + {{item.endTime}}
-
+
+ + + + + +
+ + formControlName="startTime"> - {{ filterType }} + *ngFor="let startTime of startTimes" + [value]="startTime"> + {{ startTime }} @@ -30,11 +39,11 @@ (selectionChange)="selectedAPIChanged(i)" placeholder="Select Time" #apiField - formControlName="apiType"> + formControlName="endTime"> - {{ apiType }} + *ngFor="let endTime of endTimes" + [value]="endTime"> + {{ endTime }} @@ -80,7 +89,8 @@
- + + @@ -89,11 +99,11 @@ + formControlName="startTime"> - {{ filterType }} + *ngFor="let startTime of startTimes" + [value]="startTime"> + {{ startTime }} @@ -102,11 +112,11 @@ (selectionChange)="selectedAPIChanged(i)" placeholder="Select Time" #apiField - formControlName="apiType"> + formControlName="endTime"> - {{ apiType }} + *ngFor="let endTime of endTimes" + [value]="endTime"> + {{ endTime }} @@ -152,7 +162,8 @@
- + + @@ -161,11 +172,11 @@ + formControlName="startTime"> - {{ filterType }} + *ngFor="let startTime of startTimes" + [value]="startTime"> + {{ startTime }} @@ -174,11 +185,11 @@ (selectionChange)="selectedAPIChanged(i)" placeholder="Select Time" #apiField - formControlName="apiType"> + formControlName="endTime"> - {{ apiType }} + *ngFor="let endTime of endTimes" + [value]="endTime"> + {{ endTime }} @@ -224,7 +235,8 @@
- + + @@ -233,11 +245,11 @@ + formControlName="startTime"> - {{ filterType }} + *ngFor="let startTime of startTimes" + [value]="startTime"> + {{ startTime }} @@ -246,11 +258,11 @@ (selectionChange)="selectedAPIChanged(i)" placeholder="Select Time" #apiField - formControlName="apiType"> + formControlName="endTime"> - {{ apiType }} + *ngFor="let endTime of endTimes" + [value]="endTime"> + {{ endTime }} @@ -296,7 +308,8 @@
- + + @@ -305,11 +318,11 @@ + formControlName="startTime"> - {{ filterType }} + *ngFor="let startTime of startTimes" + [value]="startTime"> + {{ startTime }} @@ -318,11 +331,11 @@ (selectionChange)="selectedAPIChanged(i)" placeholder="Select Time" #apiField - formControlName="apiType"> + formControlName="endTime"> - {{ apiType }} + *ngFor="let endTime of endTimes" + [value]="endTime"> + {{ endTime }} @@ -368,7 +381,8 @@
- + + @@ -377,11 +391,11 @@ + formControlName="startTime"> - {{ filterType }} + *ngFor="let startTime of startTimes" + [value]="startTime"> + {{ startTime }} @@ -390,11 +404,11 @@ (selectionChange)="selectedAPIChanged(i)" placeholder="Select Time" #apiField - formControlName="apiType"> + formControlName="endTime"> - {{ apiType }} + *ngFor="let endTime of endTimes" + [value]="endTime"> + {{ endTime }} @@ -440,7 +454,8 @@
- + + @@ -449,11 +464,11 @@ + formControlName="startTime"> - {{ filterType }} + *ngFor="let startTime of startTimes" + [value]="startTime"> + {{ startTime }} @@ -462,11 +477,11 @@ (selectionChange)="selectedAPIChanged(i)" placeholder="Select Time" #apiField - formControlName="apiType"> + formControlName="endTime"> - {{ apiType }} + *ngFor="let endTime of endTimes" + [value]="endTime"> + {{ endTime }} diff --git a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts index 07b9fdb..af580c4 100644 --- a/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts +++ b/ng-seed/src/app/appoinment/consultant-setting/edit-working-hours/edit-working-hours.component.ts @@ -1,26 +1,89 @@ -import { Component, OnInit } from '@angular/core'; -import { FormArray, FormBuilder, FormGroup } from '@angular/forms'; -import { MatCheckboxChange } from '@angular/material/checkbox'; -import { MatDialogRef } from '@angular/material/dialog'; +import { Component, OnInit } from "@angular/core"; +import { FormArray, FormBuilder, FormGroup } from "@angular/forms"; +import { MatCheckboxChange } from "@angular/material/checkbox"; +import { MatDialogRef } from "@angular/material/dialog"; +import { ConsultantService } from "../consultant-service/consultant.service"; @Component({ - selector: 'app-edit-working-hours', - templateUrl: './edit-working-hours.component.html', - styleUrls: ['./edit-working-hours.component.scss'] + selector: "app-edit-working-hours", + templateUrl: "./edit-working-hours.component.html", + styleUrls: ["./edit-working-hours.component.scss"], }) export class EditWorkingHoursComponent implements OnInit { + startTimes = [ + "09:00am", + "09:30am", + "10:00am", + "10:30am", + "11:00am", + "11:30am", + "12:00am", + "12:30am", + "01:00pm", + "01:00pm", + "01:30pm", + "02:00pm", + "02:30pm", + "03:00pm", + "03:30pm", + "04:00pm", + "04:30pm", + "05:00pm", + "05:30pm", + "06:00pm", + "06:30pm", + "07:00pm", + "07:30pm", + "08:00pm", + "08:30pm", + "09:00pm", + ]; + endTimes = [ + "09:00am", + "09:30am", + "10:00am", + "10:30am", + "11:00am", + "11:30am", + "12:00am", + "12:30am", + "01:00pm", + "01:00pm", + "01:30pm", + "02:00pm", + "02:30pm", + "03:00pm", + "03:30pm", + "04:00pm", + "04:30pm", + "05:00pm", + "05:30pm", + "06:00pm", + "06:30pm", + "07:00pm", + "07:30pm", + "08:00pm", + "08:30pm", + "09:00pm", + ]; + days = [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + ]; + seedData = [{ day: "Sunday", startTime: "09:00am", endTime: "09:30am" }]; - filterTypes = [ - '09:00am','09:30am','10:00am','10:30am','11:00am','11:30am','12:00am','12:30am','01:00pm','01:00pm','01:30pm', '02:00pm', '02:30pm', '03:00pm', '03:30pm', '04:00pm', '04:30pm', '05:00pm', '05:30pm', '06:00pm', '06:30pm', '07:00pm', '07:30pm', '08:00pm','08:30pm', '09:00pm', - ]; - apiTypes = [ - '09:00am','09:30am','10:00am','10:30am','11:00am','11:30am','12:00am','12:30am','01:00pm','01:00pm','01:30pm', '02:00pm', '02:30pm', '03:00pm', '03:30pm', '04:00pm', '04:30pm', '05:00pm', '05:30pm', '06:00pm', '06:30pm', '07:00pm', '07:30pm', '08:00pm','08:30pm', '09:00pm', - ]; - days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; - seedData = [ - { day: 'Sunday', filterType: '09:00am', apiType: '09:30am' }, - - ]; + Select1: any = false; + Select2: any = false; + Select3: any = false; + Select4: any = false; + Select5: any = false; + Select6: any = false; + Select7: any = false; dynamicForm: FormGroup; dynamicForm2: FormGroup; @@ -31,279 +94,392 @@ export class EditWorkingHoursComponent implements OnInit { dynamicForm7: FormGroup; // rows = [{noQuestion : 0}]; datainputForm: FormGroup; + Answer: any = []; + practitioner:any =[]; // timing: any[] = ['09:00am','09:30am','10:00am','10:30am','11:00am','11:30am','12:00am','12:30am','01:00pm','01:00pm','01:30pm', '02:00pm', '02:30pm', '03:00pm', '03:30pm', '04:00pm', '04:30pm', '05:00pm', '05:30pm', '06:00pm', '06:30pm', '07:00pm', '07:30pm', '08:00pm','08:30pm', '09:00pm',] - constructor(public dialogRef: MatDialogRef, private fb: FormBuilder) { } + constructor( + public dialogRef: MatDialogRef, + private fb: FormBuilder,public _api:ConsultantService + ) { + + this._api.getPractitionerInfo_observable$.subscribe((res) => { + console.log('nav list 3', res); + if(res.length>0){ + this.practitioner = res + } + + } + ) + } close() { this.dialogRef.close(); -} + } -// addNewRow() { -// this.rows.push({noQuestion : 0}); -// } + // addNewRow() { + // this.rows.push({noQuestion : 0}); + // } -// deleteRow(i){ -// this.rows.splice(i, 1 ); -// } + // deleteRow(i){ + // this.rows.splice(i, 1 ); + // } -ngOnInit(): void { - this.datainputForm = this.fb.group({ - dropDownTest: '09:00am', - dropDownTests: '09:30am', - dropDownTest1:'' - }) - - this.dynamicForm = this.fb.group({ - filters: this.fb.array([]) - }); - this.dynamicForm2 = this.fb.group({ - filters2: this.fb.array([]) - }); - this.dynamicForm3 = this.fb.group({ - filters3: this.fb.array([]) - }); - this.dynamicForm4 = this.fb.group({ - filters4: this.fb.array([]) - }); - this.dynamicForm5 = this.fb.group({ - filters5: this.fb.array([]) - }); - this.dynamicForm6 = this.fb.group({ - filters6: this.fb.array([]) - }); - this.dynamicForm7 = this.fb.group({ - filters7: this.fb.array([]) - }); - this.seedFiltersFormArray(); - this.seedFiltersFormArray2(); - this.seedFiltersFormArray3(); - this.seedFiltersFormArray4(); - this.seedFiltersFormArray5(); - this.seedFiltersFormArray6(); - this.seedFiltersFormArray7(); + ngOnInit(): void { + this.datainputForm = this.fb.group({ + dropDownTest: "09:00am", + dropDownTests: "09:30am", + dropDownTest1: "", + }); -} + this.dynamicForm = this.fb.group({ + filters: this.fb.array([]), + }); + this.dynamicForm2 = this.fb.group({ + filters2: this.fb.array([]), + }); + this.dynamicForm3 = this.fb.group({ + filters3: this.fb.array([]), + }); + this.dynamicForm4 = this.fb.group({ + filters4: this.fb.array([]), + }); + this.dynamicForm5 = this.fb.group({ + filters5: this.fb.array([]), + }); + this.dynamicForm6 = this.fb.group({ + filters6: this.fb.array([]), + }); + this.dynamicForm7 = this.fb.group({ + filters7: this.fb.array([]), + }); + this.seedFiltersFormArray(); + this.seedFiltersFormArray2(); + this.seedFiltersFormArray3(); + this.seedFiltersFormArray4(); + this.seedFiltersFormArray5(); + this.seedFiltersFormArray6(); + this.seedFiltersFormArray7(); + } + seedFiltersFormArray() { + this.seedData.forEach((seedDatum) => { + console.log(seedDatum); + const formGroup = this.createFilterGroup(); + if (seedDatum.endTime) { + formGroup.addControl("value", this.getFormControl()); + } + seedDatum.day = "sunday"; -seedFiltersFormArray() { - this.seedData.forEach(seedDatum => { - console.log(seedDatum) - const formGroup = this.createFilterGroup(); - if (seedDatum.apiType) { - formGroup.addControl('value', this.getFormControl()); + formGroup.patchValue(seedDatum); + this.filtersFormArray.push(formGroup); + }); + } + seedFiltersFormArray2() { + this.seedData.forEach((seedDatum) => { + const formGroup = this.createFilterGroup(); + if (seedDatum.endTime) { + formGroup.addControl("value", this.getFormControl()); + } + seedDatum.day = "monday"; + formGroup.patchValue(seedDatum); + this.filtersFormArray2.push(formGroup); + }); + } + seedFiltersFormArray3() { + this.seedData.forEach((seedDatum) => { + const formGroup = this.createFilterGroup(); + if (seedDatum.endTime) { + formGroup.addControl("value", this.getFormControl()); + } + seedDatum.day = "tuesday"; + formGroup.patchValue(seedDatum); + this.filtersFormArray3.push(formGroup); + }); + } + seedFiltersFormArray4() { + this.seedData.forEach((seedDatum) => { + const formGroup = this.createFilterGroup(); + if (seedDatum.endTime) { + formGroup.addControl("value", this.getFormControl()); + } + seedDatum.day = "wednesday"; + formGroup.patchValue(seedDatum); + this.filtersFormArray4.push(formGroup); + }); + } + seedFiltersFormArray5() { + this.seedData.forEach((seedDatum) => { + const formGroup = this.createFilterGroup(); + if (seedDatum.endTime) { + formGroup.addControl("value", this.getFormControl()); + } + seedDatum.day = "thursday"; + formGroup.patchValue(seedDatum); + this.filtersFormArray5.push(formGroup); + }); + } + seedFiltersFormArray6() { + this.seedData.forEach((seedDatum) => { + const formGroup = this.createFilterGroup(); + if (seedDatum.endTime) { + formGroup.addControl("value", this.getFormControl()); + } + seedDatum.day = "friday"; + formGroup.patchValue(seedDatum); + this.filtersFormArray6.push(formGroup); + }); + } + seedFiltersFormArray7() { + this.seedData.forEach((seedDatum) => { + const formGroup = this.createFilterGroup(); + if (seedDatum.endTime) { + formGroup.addControl("value", this.getFormControl()); + } + seedDatum.day = "saturday"; + formGroup.patchValue(seedDatum); + this.filtersFormArray7.push(formGroup); + }); + } + + createFilterGroup() { + return this.fb.group({ + startTime: [], + endTime: [], + day: [], + }); + } + createFilterGroup2() { + return this.fb.group({ + startTime: [], + endTime: [], + day: [], + }); + } + + addFilterToFiltersFormArray() { + this.filtersFormArray.push(this.createFilterGroup()); + } + addFilterToFiltersFormArray2() { + this.filtersFormArray2.push(this.createFilterGroup2()); + } + addFilterToFiltersFormArray3() { + this.filtersFormArray3.push(this.createFilterGroup()); + } + addFilterToFiltersFormArray4() { + this.filtersFormArray4.push(this.createFilterGroup()); + } + addFilterToFiltersFormArray5() { + this.filtersFormArray5.push(this.createFilterGroup()); + } + addFilterToFiltersFormArray6() { + this.filtersFormArray6.push(this.createFilterGroup()); + } + addFilterToFiltersFormArray7() { + this.filtersFormArray7.push(this.createFilterGroup()); + } + + removeFilterFromFiltersFormArray(index) { + this.filtersFormArray.removeAt(index); + } + removeFilterFromFiltersFormArray2(index) { + this.filtersFormArray2.removeAt(index); + } + removeFilterFromFiltersFormArray3(index) { + this.filtersFormArray3.removeAt(index); + } + removeFilterFromFiltersFormArray4(index) { + this.filtersFormArray4.removeAt(index); + } + removeFilterFromFiltersFormArray5(index) { + this.filtersFormArray5.removeAt(index); + } + removeFilterFromFiltersFormArray6(index) { + this.filtersFormArray6.removeAt(index); + } + removeFilterFromFiltersFormArray7(index) { + this.filtersFormArray7.removeAt(index); + } + + selectedAPIChanged(i) { + this.getFilterGroupAtIndex(i).addControl("value", this.getFormControl()); + } + + getFormControl() { + return this.fb.control(null); + } + + save() { + this.Answer = []; + let tmp = [ + this.dynamicForm.value, + this.dynamicForm2.value, + this.dynamicForm3.value, + this.dynamicForm4.value, + this.dynamicForm5.value, + this.dynamicForm6.value, + this.dynamicForm7.value, + ]; + console.log(tmp); + if (this.Select1 == true) { + this.Answer.push( {sunday: { + hours:this.dynamicForm.value.filters, + + breaks: [], + }}); + }else{ + this.Answer.push( {sunday: { + hours:[], + + breaks: [], + }}); } - seedDatum.day = 'sunday' - - formGroup.patchValue(seedDatum); - this.filtersFormArray.push(formGroup); - - - }); -} -seedFiltersFormArray2() { - this.seedData.forEach(seedDatum => { - const formGroup = this.createFilterGroup(); - if (seedDatum.apiType) { - formGroup.addControl('value', this.getFormControl()); + if (this.Select2 == true) { + this.Answer.push({monday: { + hours:this.dynamicForm2.value.filters2, + breaks: [], + }}); + + }else{ + this.Answer.push({monday: { + hours:[], + breaks: [], + }}); } - seedDatum.day = 'monday' - formGroup.patchValue(seedDatum); - this.filtersFormArray2.push(formGroup); - - - }); -} -seedFiltersFormArray3() { - this.seedData.forEach(seedDatum => { - const formGroup = this.createFilterGroup(); - if (seedDatum.apiType) { - formGroup.addControl('value', this.getFormControl()); + if (this.Select3 == true) { + this.Answer.push({tuesday: { + hours:this.dynamicForm3.value.filters3, + breaks: [], + }}); + + }else{ + this.Answer.push({tuesday: { + hours:[], + breaks: [], + }}); } - seedDatum.day = 'tuesday' - formGroup.patchValue(seedDatum); - this.filtersFormArray3.push(formGroup); - - - }); -} -seedFiltersFormArray4() { - this.seedData.forEach(seedDatum => { - const formGroup = this.createFilterGroup(); - if (seedDatum.apiType) { - formGroup.addControl('value', this.getFormControl()); + + if (this.Select4 == true) { + this.Answer.push({ wednesday: { + hours:this.dynamicForm4.value.filters4, + breaks: [], + },}); + + }else{ + this.Answer.push({ wednesday: { + hours:[], + breaks: [], + },}); } - seedDatum.day = 'wednesday' - formGroup.patchValue(seedDatum); - this.filtersFormArray4.push(formGroup); - - - }); -} -seedFiltersFormArray5() { - this.seedData.forEach(seedDatum => { - const formGroup = this.createFilterGroup(); - if (seedDatum.apiType) { - formGroup.addControl('value', this.getFormControl()); + if (this.Select5 == true) { + this.Answer.push({ thursday: { + hours:this.dynamicForm5.value.filters5, + breaks: [], + },}); + + }else{ + this.Answer.push({ thursday: { + hours:[], + breaks: [], + },}); } - seedDatum.day = 'thursday' - formGroup.patchValue(seedDatum); - this.filtersFormArray5.push(formGroup); - - - }); -} -seedFiltersFormArray6() { - this.seedData.forEach(seedDatum => { - const formGroup = this.createFilterGroup(); - if (seedDatum.apiType) { - formGroup.addControl('value', this.getFormControl()); + if (this.Select6 == true) { + this.Answer.push({ friday: { + hours:this.dynamicForm6.value.filters6, + breaks: [], + },}); + + }else{ + this.Answer.push({ friday: { + hours:[], + breaks: [], + },}); } - seedDatum.day = 'friday' - formGroup.patchValue(seedDatum); - this.filtersFormArray6.push(formGroup); - - - }); -} -seedFiltersFormArray7() { - this.seedData.forEach(seedDatum => { - const formGroup = this.createFilterGroup(); - if (seedDatum.apiType) { - formGroup.addControl('value', this.getFormControl()); + if (this.Select7 == true) { + this.Answer.push({ saturday: { + hours:this.dynamicForm7.value.filters7, + breaks: [], + }}); + + }else{ + this.Answer.push({ saturday: { + hours:[], + breaks: [], + }}); } - seedDatum.day = 'saturday' - formGroup.patchValue(seedDatum); - this.filtersFormArray7.push(formGroup); - - - }); -} - -createFilterGroup() { - return this.fb.group({ - filterType: [], - apiType: [], - day: [] - }); -} -createFilterGroup2() { - return this.fb.group({ - filterType: [], - apiType: [], - day: [] - }); -} + console.log(this.Answer); + let param; + if( this.practitioner.length>0){ + param ={id:this.practitioner[0].id,workingHours:JSON.stringify(this.Answer)} + } -addFilterToFiltersFormArray() { - this.filtersFormArray.push(this.createFilterGroup()); -} -addFilterToFiltersFormArray2() { - this.filtersFormArray2.push(this.createFilterGroup2()); -} -addFilterToFiltersFormArray3() { - this.filtersFormArray3.push(this.createFilterGroup()); -} -addFilterToFiltersFormArray4() { - this.filtersFormArray4.push(this.createFilterGroup()); -} -addFilterToFiltersFormArray5() { - this.filtersFormArray5.push(this.createFilterGroup()); -} -addFilterToFiltersFormArray6() { - this.filtersFormArray6.push(this.createFilterGroup()); -} -addFilterToFiltersFormArray7() { - this.filtersFormArray7.push(this.createFilterGroup()); -} + this._api.createPractitionerInfo(param).subscribe(res => { + if (res.status == 200) { + console.log(res) + this.dialogRef.close(1) + // this.checkedList = res.data; + }else{ + this.dialogRef.close(0) + } + } ); + + + } -removeFilterFromFiltersFormArray(index) { - this.filtersFormArray.removeAt(index); -} -removeFilterFromFiltersFormArray2(index) { - this.filtersFormArray2.removeAt(index); -} -removeFilterFromFiltersFormArray3(index) { - this.filtersFormArray3.removeAt(index); -} -removeFilterFromFiltersFormArray4(index) { - this.filtersFormArray4.removeAt(index); -} -removeFilterFromFiltersFormArray5(index) { - this.filtersFormArray5.removeAt(index); -} -removeFilterFromFiltersFormArray6(index) { - this.filtersFormArray6.removeAt(index); -} -removeFilterFromFiltersFormArray7(index) { - this.filtersFormArray7.removeAt(index); -} - -selectedAPIChanged(i) { - this.getFilterGroupAtIndex(i).addControl('value', this.getFormControl()); -} + get filtersFormArray() { + return this.dynamicForm.get("filters"); + } + get filtersFormArray2() { + return this.dynamicForm2.get("filters2"); + } + get filtersFormArray3() { + return this.dynamicForm3.get("filters3"); + } + get filtersFormArray4() { + return this.dynamicForm4.get("filters4"); + } + get filtersFormArray5() { + return this.dynamicForm5.get("filters5"); + } + get filtersFormArray6() { + return this.dynamicForm6.get("filters6"); + } + get filtersFormArray7() { + return this.dynamicForm7.get("filters7"); + } -getFormControl() { - return this.fb.control(null); -} + getFilterGroupAtIndex(index) { + return this.filtersFormArray.at(index); + } -save() { + // onSelectChange(){ + // console.log(this.datainputForm.get('dropDownTest').value); + // if( this.datainputForm.get('dropDownTest').value === 'vmnic3'){ - let tmp = [this.dynamicForm.value,this.dynamicForm2.value,this.dynamicForm3.value,this.dynamicForm4.value,this.dynamicForm5.value,this.dynamicForm6.value,this.dynamicForm7.value] - console.log(tmp); - - -} + // this.datainputForm.get('dropDownTest1').disable(); + // }else{ + // this.datainputForm.get('dropDownTest1').enable(); + // } -get filtersFormArray() { - return (this.dynamicForm.get('filters')); -} -get filtersFormArray2() { - return (this.dynamicForm2.get('filters2')); -} -get filtersFormArray3() { - return (this.dynamicForm3.get('filters3')); -} -get filtersFormArray4() { - return (this.dynamicForm4.get('filters4')); -} -get filtersFormArray5() { - return (this.dynamicForm5.get('filters5')); -} -get filtersFormArray6() { - return (this.dynamicForm6.get('filters6')); -} -get filtersFormArray7() { - return (this.dynamicForm7.get('filters7')); -} + // console.log(this.datainputForm.get('dropDownTests').value); + // if( this.datainputForm.get('dropDownTests').value === 'vmnic3'){ -getFilterGroupAtIndex(index) { - return (this.filtersFormArray.at(index)); -} - -// onSelectChange(){ -// console.log(this.datainputForm.get('dropDownTest').value); -// if( this.datainputForm.get('dropDownTest').value === 'vmnic3'){ - -// this.datainputForm.get('dropDownTest1').disable(); -// }else{ -// this.datainputForm.get('dropDownTest1').enable(); -// } - -// console.log(this.datainputForm.get('dropDownTests').value); -// if( this.datainputForm.get('dropDownTests').value === 'vmnic3'){ - -// this.datainputForm.get('dropDownTest1').disable(); -// }else{ -// this.datainputForm.get('dropDownTest1').enable(); -// } -// } + // this.datainputForm.get('dropDownTest1').disable(); + // }else{ + // this.datainputForm.get('dropDownTest1').enable(); + // } + // } onSubmit() { console.log(this.datainputForm.value); } - showOptions(event:MatCheckboxChange): void { - console.log(event.checked); + showOptions(event: MatCheckboxChange, value): void { + console.log(event.checked, value); + if (value == "sunday" && event.checked == true) { + this.Answer.push(this.dynamicForm.value); + } + + // this.form['value'].admin_checked = event.checked // console.log(this.form['value'].admin_checked) } diff --git a/ng-seed/src/app/end-user/end-user.service.ts b/ng-seed/src/app/end-user/end-user.service.ts index 104db2a..4fe5b28 100644 --- a/ng-seed/src/app/end-user/end-user.service.ts +++ b/ng-seed/src/app/end-user/end-user.service.ts @@ -15,7 +15,7 @@ private apiUrl = environment.apiEndpoint; getServicesListDetails(): Observable { console.log('IN') - return this._http.post(this.apiUrl + "getServicesDetails",{}) + return this._http.post(this.apiUrl + "getServicesDetails",{}) // .pipe( // catchError(this.handleError('role', [])) // ) diff --git a/ng-seed/src/environments/environment.ts b/ng-seed/src/environments/environment.ts index 7409a9d..c2bb685 100644 --- a/ng-seed/src/environments/environment.ts +++ b/ng-seed/src/environments/environment.ts @@ -6,5 +6,7 @@ export const environment = { production: false, environmentName: 'Testing Environment',//Localhost Environment. + apiEndpoint:'http://192.168.1.20:8080/api/', + };