I am new to angular, I am using the method, it's very confusing for me. I have a method and inside I have another method. but while running I got this error in the console - this.getAllJobs is not a function
my content component:
<mat-radio-group class="pl-30 pr-30 d-flex flex-column" [(ngModel)]="visibility" (ngModelChange)="filterChange()">
<p class="secondary-color fz-14 sf-medium" [textContent]="'filter.visibility' | translate"></p>
<mat-radio-button class="mb-10" [value]=null>{{'filter.all' | translate}}</mat-radio-button>
<mat-radio-button class="mb-10" *ngFor="let visibility of jobVisibilities"
[value]="visibility">{{'job.visibility.'+visibility | translate}}</mat-radio-button>
</mat-radio-group>
here iam calling the method. my content component ts:
public getAllJobs: any;
filterChange(){
this.getAllJobs({"visibility": this.visibility, "timeRequirement":this.timeRequirement,"duration":this.duration,"payment":this.payment,"experience":this.experience});}
header component.ts:
getAllJobs(filterName?:any) {
this.jobService.findAll(this.getQuery(filterName)).subscribe((res: Page<Job>) => {
this.jobs = res;
},
error => {
this.messages = error;
})}
here angular extent method I used. i'am passing data from the content component click event to header component. here I used (this) type only. but I am getting this error. Does anyone know how to fix this?