From 86cc8872d6e44c348d08e21d825155b42af80351 Mon Sep 17 00:00:00 2001 From: sorvylenny Date: Thu, 30 Mar 2023 19:24:47 -0500 Subject: [PATCH 1/3] modelo de tabla --- src/app/app-routing.module.ts | 32 +++++++++-- src/app/app.component.css | 5 ++ src/app/app.component.html | 38 +++++++++++++ src/app/app.component.ts | 46 +++++++++++++++- src/app/app.module.ts | 9 +++- src/app/rick/interfaces/rick.interfaces.ts | 53 +++++++++++++++++++ src/app/rick/material/material.module.ts | 33 ++++++++++++ .../rick/pages/listar/listar.component.html | 3 ++ src/app/rick/pages/listar/listar.component.ts | 15 ++++++ src/app/rick/rick.module.ts | 19 +++++++ src/app/services/rick.service.ts | 9 ++++ src/environments/environment.prod.ts | 3 +- src/environments/environment.ts | 3 +- 13 files changed, 260 insertions(+), 8 deletions(-) create mode 100644 src/app/rick/interfaces/rick.interfaces.ts create mode 100644 src/app/rick/material/material.module.ts create mode 100644 src/app/rick/pages/listar/listar.component.html create mode 100644 src/app/rick/pages/listar/listar.component.ts create mode 100644 src/app/rick/rick.module.ts create mode 100644 src/app/services/rick.service.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 0297262..970c4a9 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,10 +1,36 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { ListarComponent } from './rick/pages/listar/listar.component'; -const routes: Routes = []; +const routes: Routes = [ + { + path: '', + component: ListarComponent, + pathMatch: 'full' + }, + + /* { + path: 'buscar', + component: + }, + { + path: 'ordenar', + component: + }, */ + { + path: '**', + redirectTo: '' + } + + +]; @NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + imports: [ + RouterModule.forRoot(routes) + ], + exports: [ + RouterModule + ] }) export class AppRoutingModule { } diff --git a/src/app/app.component.css b/src/app/app.component.css index e69de29..8b2180f 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -0,0 +1,5 @@ + + +table { + width: 60%; + } \ No newline at end of file diff --git a/src/app/app.component.html b/src/app/app.component.html index 139597f..dd7a4e5 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,2 +1,40 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
No. {{element.position}} Name {{element.name}} Weight {{element.weight}} Symbol {{element.symbol}}
+ + +
+ + + + \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8dc32c0..2a0a434 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,52 @@ -import { Component } from '@angular/core'; +import { AfterViewInit, Component, ViewChild } from '@angular/core'; +import { MatPaginator } from '@angular/material/paginator'; +import { MatTableDataSource } from '@angular/material/table'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) -export class AppComponent { +export class AppComponent implements AfterViewInit { title = 'rickandmortyApp'; + displayedColumns: string[] = ['position', 'name', 'weight', 'symbol']; + dataSource = new MatTableDataSource(ELEMENT_DATA); + + + @ViewChild(MatPaginator) paginator!: MatPaginator; + + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + } +} + +export interface PeriodicElement { + name: string; + position: number; + weight: number; + symbol: string; } + +const ELEMENT_DATA: PeriodicElement[] = [ + {position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'}, + {position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'}, + {position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'}, + {position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'}, + {position: 5, name: 'Boron', weight: 10.811, symbol: 'B'}, + {position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'}, + {position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'}, + {position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'}, + {position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'}, + {position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'}, + {position: 11, name: 'Sodium', weight: 22.9897, symbol: 'Na'}, + {position: 12, name: 'Magnesium', weight: 24.305, symbol: 'Mg'}, + {position: 13, name: 'Aluminum', weight: 26.9815, symbol: 'Al'}, + {position: 14, name: 'Silicon', weight: 28.0855, symbol: 'Si'}, + {position: 15, name: 'Phosphorus', weight: 30.9738, symbol: 'P'}, + {position: 16, name: 'Sulfur', weight: 32.065, symbol: 'S'}, + {position: 17, name: 'Chlorine', weight: 35.453, symbol: 'Cl'}, + {position: 18, name: 'Argon', weight: 39.948, symbol: 'Ar'}, + {position: 19, name: 'Potassium', weight: 39.0983, symbol: 'K'}, + {position: 20, name: 'Calcium', weight: 40.078, symbol: 'Ca'}, +]; + diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8386405..a921837 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,17 +4,24 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { MaterialModule } from './rick/material/material.module'; +import { RickModule } from './rick/rick.module'; + @NgModule({ declarations: [ - AppComponent + AppComponent, + + ], imports: [ BrowserModule, AppRoutingModule, BrowserAnimationsModule, + MaterialModule, + RickModule ], providers: [], diff --git a/src/app/rick/interfaces/rick.interfaces.ts b/src/app/rick/interfaces/rick.interfaces.ts new file mode 100644 index 0000000..234717f --- /dev/null +++ b/src/app/rick/interfaces/rick.interfaces.ts @@ -0,0 +1,53 @@ +export interface Rickmorty { + info: Info; + results: Result[]; +} + +export interface Info { + count: number; + pages: number; + next: string; + prev: null; +} + +export interface Result { + id: number; + name: string; + status: Status; + species: Species; + type: Type; + gender: Gender; + origin: Location; + location: Location; + image: string; + episode: string[]; + url: string; + created: Date; +} + +export enum Gender { + Female = "Female", + Male = "Male", +} + +export interface Location { + name: string; + url: string; +} + +export enum Species { + Alien = "Alien", + Human = "Human", + Unknown = "unknown", +} + +export enum Status { + Alive = "Alive", +} + +export enum Type { + Chair = "Chair", + Clone = "Clone", + Empty = "", + Pickle = "Pickle", +} diff --git a/src/app/rick/material/material.module.ts b/src/app/rick/material/material.module.ts new file mode 100644 index 0000000..c1b76db --- /dev/null +++ b/src/app/rick/material/material.module.ts @@ -0,0 +1,33 @@ +import { NgModule } from '@angular/core'; + +import { MatIconModule } from '@angular/material/icon'; +import {MatListModule} from '@angular/material/list'; + +import { MatSidenavModule } from '@angular/material/sidenav'; +import {MatTableModule} from '@angular/material/table'; +import { MatToolbarModule } from '@angular/material/toolbar'; + + + +@NgModule({ + declarations: [], + + exports:[ + MatIconModule, + MatListModule, + + MatSidenavModule, + MatTableModule, + MatToolbarModule + + ], + imports:[ + MatIconModule, + MatListModule, + + MatSidenavModule, + MatTableModule, + MatToolbarModule + ] +}) +export class MaterialModule { } diff --git a/src/app/rick/pages/listar/listar.component.html b/src/app/rick/pages/listar/listar.component.html new file mode 100644 index 0000000..b28b04f --- /dev/null +++ b/src/app/rick/pages/listar/listar.component.html @@ -0,0 +1,3 @@ + + + diff --git a/src/app/rick/pages/listar/listar.component.ts b/src/app/rick/pages/listar/listar.component.ts new file mode 100644 index 0000000..c58ca99 --- /dev/null +++ b/src/app/rick/pages/listar/listar.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-listar', + templateUrl: './listar.component.html', + styles: [''] +}) +export class ListarComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/rick/rick.module.ts b/src/app/rick/rick.module.ts new file mode 100644 index 0000000..dae446d --- /dev/null +++ b/src/app/rick/rick.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ListarComponent } from './pages/listar/listar.component'; +import { MaterialModule } from './material/material.module'; + + + + + +@NgModule({ + declarations: [ + ListarComponent + ], + imports: [ + CommonModule, + MaterialModule + ] +}) +export class RickModule { } diff --git a/src/app/services/rick.service.ts b/src/app/services/rick.service.ts new file mode 100644 index 0000000..d7fc48f --- /dev/null +++ b/src/app/services/rick.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class RickService { + + constructor() { } +} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 3612073..f27c64f 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,3 +1,4 @@ export const environment = { - production: true + production: true, + baseUrl: 'https://rickandmortyapi.com/api/character' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index f56ff47..de02742 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,7 +3,8 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false + production: false, + baseUrl: 'https://rickandmortyapi.com/api/character' }; /* From 62cc79d279214721f9e906df1686b4287672ed76 Mon Sep 17 00:00:00 2001 From: sorvylenny Date: Mon, 3 Apr 2023 12:53:00 -0500 Subject: [PATCH 2/3] listado-paginacion-renderizacion --- src/app/app-routing.module.ts | 5 +- src/app/app.component.css | 6 +- src/app/app.component.html | 38 +------------ src/app/app.component.ts | 49 ++-------------- src/app/app.module.ts | 5 +- .../{rick => }/material/material.module.ts | 11 ++++ src/app/rick/interfaces/rick.interfaces.ts | 26 ++++----- .../rick/pages/listar/listar.component.html | 3 - src/app/rick/pages/listar/listar.component.ts | 15 ----- src/app/rick/pages/tabla/tabla.component.css | 13 +++++ src/app/rick/pages/tabla/tabla.component.html | 56 +++++++++++++++++++ src/app/rick/pages/tabla/tabla.component.ts | 54 ++++++++++++++++++ src/app/rick/rick.module.ts | 7 ++- src/app/rick/services/rick.service.ts | 22 ++++++++ src/app/services/rick.service.ts | 9 --- 15 files changed, 190 insertions(+), 129 deletions(-) rename src/app/{rick => }/material/material.module.ts (68%) delete mode 100644 src/app/rick/pages/listar/listar.component.html delete mode 100644 src/app/rick/pages/listar/listar.component.ts create mode 100644 src/app/rick/pages/tabla/tabla.component.css create mode 100644 src/app/rick/pages/tabla/tabla.component.html create mode 100644 src/app/rick/pages/tabla/tabla.component.ts create mode 100644 src/app/rick/services/rick.service.ts delete mode 100644 src/app/services/rick.service.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 970c4a9..dbcf789 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,11 +1,12 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { ListarComponent } from './rick/pages/listar/listar.component'; +import { TablaComponent } from './rick/pages/tabla/tabla.component'; + const routes: Routes = [ { path: '', - component: ListarComponent, + component: TablaComponent, pathMatch: 'full' }, diff --git a/src/app/app.component.css b/src/app/app.component.css index 8b2180f..8b57b00 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -1,5 +1,5 @@ -table { - width: 60%; - } \ No newline at end of file + + + diff --git a/src/app/app.component.html b/src/app/app.component.html index dd7a4e5..c9d1423 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,40 +1,4 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
No. {{element.position}} Name {{element.name}} Weight {{element.weight}} Symbol {{element.symbol}}
- - -
- - - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2a0a434..c5605c3 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,52 +1,15 @@ -import { AfterViewInit, Component, ViewChild } from '@angular/core'; -import { MatPaginator } from '@angular/material/paginator'; +import { Component } from '@angular/core'; +import { MatPaginatorIntl } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; +import { Subject } from 'rxjs'; + + @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) -export class AppComponent implements AfterViewInit { +export class AppComponent { title = 'rickandmortyApp'; - displayedColumns: string[] = ['position', 'name', 'weight', 'symbol']; - dataSource = new MatTableDataSource(ELEMENT_DATA); - - - @ViewChild(MatPaginator) paginator!: MatPaginator; - - ngAfterViewInit() { - this.dataSource.paginator = this.paginator; - } } - -export interface PeriodicElement { - name: string; - position: number; - weight: number; - symbol: string; -} - -const ELEMENT_DATA: PeriodicElement[] = [ - {position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'}, - {position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'}, - {position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'}, - {position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'}, - {position: 5, name: 'Boron', weight: 10.811, symbol: 'B'}, - {position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'}, - {position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'}, - {position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'}, - {position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'}, - {position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'}, - {position: 11, name: 'Sodium', weight: 22.9897, symbol: 'Na'}, - {position: 12, name: 'Magnesium', weight: 24.305, symbol: 'Mg'}, - {position: 13, name: 'Aluminum', weight: 26.9815, symbol: 'Al'}, - {position: 14, name: 'Silicon', weight: 28.0855, symbol: 'Si'}, - {position: 15, name: 'Phosphorus', weight: 30.9738, symbol: 'P'}, - {position: 16, name: 'Sulfur', weight: 32.065, symbol: 'S'}, - {position: 17, name: 'Chlorine', weight: 35.453, symbol: 'Cl'}, - {position: 18, name: 'Argon', weight: 39.948, symbol: 'Ar'}, - {position: 19, name: 'Potassium', weight: 39.0983, symbol: 'K'}, - {position: 20, name: 'Calcium', weight: 40.078, symbol: 'Ca'}, -]; - diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a921837..3cf7e14 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,8 +4,10 @@ import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { MaterialModule } from './rick/material/material.module'; + import { RickModule } from './rick/rick.module'; +import { MaterialModule } from './material/material.module'; +import { HttpClientModule } from '@angular/common/http'; @@ -20,6 +22,7 @@ import { RickModule } from './rick/rick.module'; BrowserModule, AppRoutingModule, BrowserAnimationsModule, + HttpClientModule, MaterialModule, RickModule diff --git a/src/app/rick/material/material.module.ts b/src/app/material/material.module.ts similarity index 68% rename from src/app/rick/material/material.module.ts rename to src/app/material/material.module.ts index c1b76db..6948e4f 100644 --- a/src/app/rick/material/material.module.ts +++ b/src/app/material/material.module.ts @@ -1,9 +1,14 @@ import { NgModule } from '@angular/core'; +import {MatCardModule} from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import {MatListModule} from '@angular/material/list'; +import {CdkTableModule} from '@angular/cdk/table'; + + import { MatSidenavModule } from '@angular/material/sidenav'; +import {MatPaginatorModule} from '@angular/material/paginator'; import {MatTableModule} from '@angular/material/table'; import { MatToolbarModule } from '@angular/material/toolbar'; @@ -13,19 +18,25 @@ import { MatToolbarModule } from '@angular/material/toolbar'; declarations: [], exports:[ + MatCardModule, + CdkTableModule, MatIconModule, MatListModule, MatSidenavModule, + MatPaginatorModule, MatTableModule, MatToolbarModule ], imports:[ + MatCardModule, + CdkTableModule, MatIconModule, MatListModule, MatSidenavModule, + MatPaginatorModule, MatTableModule, MatToolbarModule ] diff --git a/src/app/rick/interfaces/rick.interfaces.ts b/src/app/rick/interfaces/rick.interfaces.ts index 234717f..9060e8f 100644 --- a/src/app/rick/interfaces/rick.interfaces.ts +++ b/src/app/rick/interfaces/rick.interfaces.ts @@ -11,23 +11,23 @@ export interface Info { } export interface Result { - id: number; - name: string; - status: Status; - species: Species; - type: Type; - gender: Gender; - origin: Location; - location: Location; - image: string; - episode: string[]; - url: string; - created: Date; + id: number; + name: string; + status: string | Status; + species?: Species; + type?: Type; + gender: string |Gender; + origin?: Location; + location?: Location; + image?: string; + episode?: string[]; + url?: string; + created?: Date; } export enum Gender { Female = "Female", - Male = "Male", + Male = "Male", } export interface Location { diff --git a/src/app/rick/pages/listar/listar.component.html b/src/app/rick/pages/listar/listar.component.html deleted file mode 100644 index b28b04f..0000000 --- a/src/app/rick/pages/listar/listar.component.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/app/rick/pages/listar/listar.component.ts b/src/app/rick/pages/listar/listar.component.ts deleted file mode 100644 index c58ca99..0000000 --- a/src/app/rick/pages/listar/listar.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-listar', - templateUrl: './listar.component.html', - styles: [''] -}) -export class ListarComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/rick/pages/tabla/tabla.component.css b/src/app/rick/pages/tabla/tabla.component.css new file mode 100644 index 0000000..1ff7add --- /dev/null +++ b/src/app/rick/pages/tabla/tabla.component.css @@ -0,0 +1,13 @@ + +table { + width: 100%; +} + +a { + cursor: pointer; +} + +th{ + width: 20%; +} + diff --git a/src/app/rick/pages/tabla/tabla.component.html b/src/app/rick/pages/tabla/tabla.component.html new file mode 100644 index 0000000..1273ab8 --- /dev/null +++ b/src/app/rick/pages/tabla/tabla.component.html @@ -0,0 +1,56 @@ +
+ + Rick&MortyAPP + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
No. {{element.id}} Nombre {{element.name}} Genero {{element.gender}} Tipo {{element.type}} Estatus {{element.status}} Ver más + + search + +
+ + + +
+
diff --git a/src/app/rick/pages/tabla/tabla.component.ts b/src/app/rick/pages/tabla/tabla.component.ts new file mode 100644 index 0000000..e166141 --- /dev/null +++ b/src/app/rick/pages/tabla/tabla.component.ts @@ -0,0 +1,54 @@ +import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'; +import { Rickmorty } from '../../interfaces/rick.interfaces'; +import { RickService } from '../../services/rick.service'; +import { MatTableDataSource } from '@angular/material/table'; +import { MatPaginator } from '@angular/material/paginator'; + + + + +@Component({ + selector: 'app-tabla', + templateUrl: './tabla.component.html', + styleUrls: ['./tabla.component.css'] +}) + +export class TablaComponent implements AfterViewInit, OnInit { + + Columns: string[] = [ 'id', 'name', 'gender', 'type', 'status', 'ver' ]; + dataSource = new MatTableDataSource; + + + constructor( private rickService: RickService ) { } + + @ViewChild(MatPaginator) paginator!: MatPaginator; + + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + } + + cargaRick() { + this.rickService.getRick() + .subscribe( (res:any) =>{ + console.log(res); + if (!res.info){ + return console.log ('no info check data '); + } + else { + this.dataSource.data = res.results; + } + }) + } + + ngOnInit(): void { + this.cargaRick() + + + } +} + + + + + + diff --git a/src/app/rick/rick.module.ts b/src/app/rick/rick.module.ts index dae446d..d7b4c86 100644 --- a/src/app/rick/rick.module.ts +++ b/src/app/rick/rick.module.ts @@ -1,7 +1,8 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { ListarComponent } from './pages/listar/listar.component'; -import { MaterialModule } from './material/material.module'; + +import { TablaComponent } from './pages/tabla/tabla.component'; +import { MaterialModule } from '../material/material.module'; @@ -9,7 +10,7 @@ import { MaterialModule } from './material/material.module'; @NgModule({ declarations: [ - ListarComponent + TablaComponent, ], imports: [ CommonModule, diff --git a/src/app/rick/services/rick.service.ts b/src/app/rick/services/rick.service.ts new file mode 100644 index 0000000..725dd45 --- /dev/null +++ b/src/app/rick/services/rick.service.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { environment } from 'src/environments/environment'; +import { Observable } from 'rxjs'; +import { Rickmorty } from '../interfaces/rick.interfaces'; + + + +@Injectable({ + providedIn: 'root' +}) +export class RickService { + + private baseUrl: string = environment.baseUrl; + + + constructor(private http: HttpClient) { } + + getRick() : Observable { + return this.http.get(`${this.baseUrl}`); + } +} diff --git a/src/app/services/rick.service.ts b/src/app/services/rick.service.ts deleted file mode 100644 index d7fc48f..0000000 --- a/src/app/services/rick.service.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Injectable } from '@angular/core'; - -@Injectable({ - providedIn: 'root' -}) -export class RickService { - - constructor() { } -} From 71980f3a3d85cb2df98b0d9ae673451c4f6224c1 Mon Sep 17 00:00:00 2001 From: sorvylenny Date: Mon, 3 Apr 2023 14:15:41 -0500 Subject: [PATCH 3/3] modulo borrado de Rick --- src/app/rick/rick.module.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/rick/rick.module.ts b/src/app/rick/rick.module.ts index d7b4c86..96f1629 100644 --- a/src/app/rick/rick.module.ts +++ b/src/app/rick/rick.module.ts @@ -6,15 +6,13 @@ import { MaterialModule } from '../material/material.module'; - - @NgModule({ declarations: [ TablaComponent, ], imports: [ CommonModule, - MaterialModule + MaterialModule, ] }) export class RickModule { }