ngOnInit 示例以获取网页浏览量的学生列表
export class HomePage implements OnInit {
...
....
constructor(....){}
ngOnInit(){
this._studentService.getAllStudents().subscribe(
(students: Students[]) => this.students = students,
)
export class HomePage implements OnInit {
...
....
constructor(....){}
ngOnInit(){
this._studentService.getAllStudents().subscribe(
(students: Students[]) => this.students = students,
)