- Built with Angular, bootstrap 5 & json web server
This project was generated with Angular CLI version 13.1.2.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NgToastService } from 'ng-angular-popup';
import { StudentService } from '../../services/student.service';
@Component({
selector: 'app-list-student',
templateUrl: './list-student.component.html',
styleUrls: ['./list-student.component.css'],
})
export class ListStudentComponent implements OnInit {
public students: any = [];
public loading: boolean = true;
public darkTheme: boolean = false;
dtOptions: DataTables.Settings = {};
constructor(
private student: StudentService,
private router: Router,
private toast: NgToastService
) {}
ngOnInit(): void {
this.dtOptions = {
pagingType: 'full_numbers',
pageLength: 30,
processing: true,
};
this.student.getAllStudent().subscribe((data) => {
this.students = data;
this.loading = false;
});
}
My website mahmoudosman.com
LinkedIn Profile Link: LinkedIn