single company name,camel case
This commit is contained in:
parent
6edccd86bc
commit
be841d8ad5
@ -299,7 +299,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field fxFlex="38%" fxFlex.xs="100%" *ngIf="pdMain.fk_customer_segment.value != '8'">
|
<mat-form-field fxFlex="38%" fxFlex.xs="100%" *ngIf="pdMain.fk_customer_segment.value != '8'">
|
||||||
<input matInput autocomplete="off" [placeholder]="cus_abbr_value == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text">
|
<input matInput autocomplete="off" [placeholder]="cus_abbr_value == 'SEP_INDV' ? 'Nature of Service' : 'Company / Firm Name'" formControlName="company_name" type="text" [ngModel]="range" (input)="capitalize($event.target.value)" >
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field fxFlex="38%" fxFlex.xs="100%">
|
<mat-form-field fxFlex="38%" fxFlex.xs="100%">
|
||||||
|
|||||||
@ -83,6 +83,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
role_id: any;
|
role_id: any;
|
||||||
prod_seg: any;
|
prod_seg: any;
|
||||||
usertype: string;
|
usertype: string;
|
||||||
|
range: any;
|
||||||
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
|
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
|
||||||
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
|
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
|
||||||
private titleCase : TitleCasePipe,private userService:UserService,private matDialog:MatDialog) {
|
private titleCase : TitleCasePipe,private userService:UserService,private matDialog:MatDialog) {
|
||||||
@ -971,6 +972,25 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
this.ListPdComponent.showListView(true);
|
this.ListPdComponent.showListView(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
capitalize(str) {
|
||||||
|
|
||||||
|
console.log(str)
|
||||||
|
|
||||||
|
console.log(this.range)
|
||||||
|
var splitStr = str.toLowerCase().split(' ');
|
||||||
|
for (var i = 0; i < splitStr.length; i++) {
|
||||||
|
// You do not need to check if i is larger than splitStr length, as your for does that for you
|
||||||
|
// Assign it back to the array
|
||||||
|
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
|
||||||
|
}
|
||||||
|
// Directly return the joined string
|
||||||
|
let d = splitStr.join(' ');
|
||||||
|
console.log(d)
|
||||||
|
this._PDtriggerForm.get('company_name');
|
||||||
|
console.log(this._PDtriggerForm.get('company_name'))
|
||||||
|
this.range = d
|
||||||
|
return d
|
||||||
}
|
}
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.ListPdComponent.showListView(true);
|
this.ListPdComponent.showListView(true);
|
||||||
|
|||||||
@ -34,7 +34,8 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
|||||||
constructor(private quesService:QuesFormService,private _fb:FormBuilder, private matDialog:MatDialog, private loaderService:LoaderService) { }
|
constructor(private quesService:QuesFormService,private _fb:FormBuilder, private matDialog:MatDialog, private loaderService:LoaderService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log(this.json_answers)
|
||||||
|
console.log(this.whole_json)
|
||||||
this.parent_ques = this.currFormArrayObj
|
this.parent_ques = this.currFormArrayObj
|
||||||
if(this.parent_ques.type == '9' && this.parent_ques.answers && this.parent_ques.answers.length > 0) {
|
if(this.parent_ques.type == '9' && this.parent_ques.answers && this.parent_ques.answers.length > 0) {
|
||||||
this.autoCompleteAns =this.formGroupN.get(this.parent_ques.question_key).valueChanges.pipe(
|
this.autoCompleteAns =this.formGroupN.get(this.parent_ques.question_key).valueChanges.pipe(
|
||||||
@ -124,6 +125,17 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
|||||||
this.json_answers1=[{"question":"a","answer":"a"},{"question":"b","answer":"b"},{"question":"c","answer":"c"}]
|
this.json_answers1=[{"question":"a","answer":"a"},{"question":"b","answer":"b"},{"question":"c","answer":"c"}]
|
||||||
console.log('answers');
|
console.log('answers');
|
||||||
console.log(this.json_answers);
|
console.log(this.json_answers);
|
||||||
|
console.log(this.parent_ques);
|
||||||
|
|
||||||
|
if(this.parent_ques.answers && this.parent_ques.answers instanceof Array){
|
||||||
|
console.log(this.parent_ques.answers.length)
|
||||||
|
if(this.parent_ques.answers.length == 1){
|
||||||
|
console.log(this.parent_ques.answers.answer_id)
|
||||||
|
this.formGroupN.get(this.parent_ques.question_key).patchValue(this.parent_ques.answers[0].answer_id || '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//console.log(this.group_key);
|
//console.log(this.group_key);
|
||||||
if(this.json_answers!=null && this.json_answers != undefined && this.json_answers) {
|
if(this.json_answers!=null && this.json_answers != undefined && this.json_answers) {
|
||||||
|
|
||||||
@ -131,6 +143,7 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
|||||||
// console.clear()
|
// console.clear()
|
||||||
|
|
||||||
if(this.json_answers!=null && this.json_answers!= undefined && this.json_answers&& !this.group_key) {
|
if(this.json_answers!=null && this.json_answers!= undefined && this.json_answers&& !this.group_key) {
|
||||||
|
|
||||||
this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || ''))
|
this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || ''))
|
||||||
|
|
||||||
this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'','','','TS')
|
this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'','','','TS')
|
||||||
@ -142,6 +155,10 @@ export class DynamicQuestionTemplateComponent implements OnInit {
|
|||||||
|
|
||||||
this.formGroupN.get(this.parent_ques.question_key)
|
this.formGroupN.get(this.parent_ques.question_key)
|
||||||
|
|
||||||
|
console.log(this.group_key)
|
||||||
|
console.log(this.whole_form)
|
||||||
|
console.log( this.whole_form.get(this.group_key))
|
||||||
|
|
||||||
|
|
||||||
this.whole_form.get(this.group_key).patchValue(this.json_answers)
|
this.whole_form.get(this.group_key).patchValue(this.json_answers)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user