Whenever I run my TypeScript file in Angular, I encounter an error in the console.
Error: compiler.js:215 Uncaught Error: Can't resolve all parameters for SearchNameComponent: ([object Object], ?).
Below is my complete code:
import { Component, OnInit } from '@angular/core';
import {StudentSearchService , Students} from '../service/student-search.service';
import DataSource from 'devextreme/data/data_source';
@Component({
selector: 'app-search-name',
templateUrl: './search-name.component.html',
styleUrls: ['./search-name.component.css'],
providers: [StudentSearchService],
})
export class SearchNameComponent implements OnInit {
std: Students[];
data: any = '';
constructor(public students: StudentSearchService, data: any) {
this.std = students.getstudent();
console.log(data);
}
ngOnInit() {
}
}