Escolar Documentos
Profissional Documentos
Cultura Documentos
node.js
https://nodejs.org/en/
angular
https://angular.io/start
bootstrap
https://getbootstrap.com.br/
json-server
https://www.npmjs.com/package/json-server
angular material
https://material.angular.io/
no aluno.ts
criar o vetor
alunos: Aluno [ ]=[
{id:1,nome: 'José',cpf: '123-456-789-10',email:'jose@gmail.com',idade:45},
{id:2,nome: 'Maria',cpf: '123-456-789-11',email:'maria@gmail.com',idade:20},
{id:3,nome: 'João',cpf: '123-456-789-12',email:'joao@gmail.com',idade:30},
{id:4,nome: 'Nair',cpf: '123-456-789-13',email:'nair@gmail.com',idade:26},
];
no module.ts colocar
import { HttpClientModule } from '@angular/common/http';
e importar o httpclientModule
<ng-container matColumnDef="nome">
<th mat-header-cell *matHeaderCellDef> Nome </th>
<td mat-cell *matCellDef="let alunos"> {{ alunos.nome }} </td>v
</ng-container>
displayedColumns = ['nome'];
{
"alunos": [
@Injectable({
providedIn: 'root'
})
export class ListarService {
constructor(private http:HttpClient) { }
constructor(private listarServico:ListarService) {
this.pegarAlunos();
}
pegarAlunos():void{
this.listarServico.pegarTodos().subscribe((alunos:any) => (this.alunos =
alunos));
}