Pool module refactor

This commit is contained in:
Daniel Rodriguez 2021-08-05 19:22:00 +02:00
parent ea73b94e24
commit c266c7602b
12 changed files with 50 additions and 22 deletions

View file

@ -1,11 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LayoutComponent } from 'src/components/layout/layout.component';
const routes: Routes = [
{ path: '', component: LayoutComponent, pathMatch: 'full' },
{ path: '**', component: LayoutComponent, pathMatch: 'full' }
{
path: '',
loadChildren: () => import('../modules/pool/pool.module').then(m => m.PoolModule)
},
{
path: '**',
loadChildren: () => import('../modules/pool/pool.module').then(m => m.PoolModule)
}
];
@NgModule({

View file

@ -3,23 +3,16 @@ import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HomeComponent } from '../components/home/home.component';
import { ReactiveFormsModule } from '@angular/forms';
import { LayoutComponent } from '../components/layout/layout.component';
import { PoolService } from 'src/shared/pool.service';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
LayoutComponent
],
imports: [
BrowserModule,
AppRoutingModule,
ReactiveFormsModule
AppRoutingModule
],
providers: [PoolService],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

View file

@ -7,15 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-66417033-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-66417033-2');
</script>
</head>
<body style="background-color: #000000;">
<app-root></app-root>

View file

@ -3,7 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms';
import { Champion } from 'src/models/champion';
import { Bonus } from 'src/models/bonus';
import { PoolService } from 'src/shared/pool.service';
import { PoolService } from 'src/modules/pool/services/pool.service';
import { DomSanitizer } from '@angular/platform-browser';
import * as _ from 'lodash';

View file

@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LayoutComponent } from 'src/modules/pool/components/layout/layout.component';
const routes: Routes = [
{ path: '', component: LayoutComponent, pathMatch: 'full' },
{ path: '**', component: LayoutComponent, pathMatch: 'full' }
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class PoolRoutingModule { }

View file

@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { PoolRoutingModule } from './pool-routing.module';
import { ReactiveFormsModule } from '@angular/forms';
import { PoolService } from 'src/modules/pool/services/pool.service';
import { LayoutComponent } from './components/layout/layout.component';
import { HomeComponent } from './components/home/home.component';
import { CommonModule } from '@angular/common';
@NgModule({
declarations: [
LayoutComponent,
HomeComponent
],
imports: [
CommonModule,
PoolRoutingModule,
ReactiveFormsModule
],
providers: [PoolService]
})
export class PoolModule { }

View file

@ -211,6 +211,7 @@ export class PoolService {
champion.isSelected = false;
return champion;
});
this.setChampions();
this.updateDataToShare();
}