I have angular class
- export class Parameters
- {
- SearchString:string;
- }
I have code in component.ts file
- strparameters:Parameters;
- ngOnInit() {
- this.strparameters.SearchString="";
- this.dataservice.getEmployee(this.strparameters).subscribe((tempdate) =>{
- this.employeelist=tempdate;
- })
- ,err=>{
- console.log(err);
- }
- }
it gives me error -
ERROR TypeError: Cannot set property 'SearchString' of undefined
how can assign input value to SearchString in component.ts file ? please help here