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,
)