From 1575621fee78cd7fa1010c83fe6a0099399a5040 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:36:38 +0200 Subject: [PATCH 01/15] feat(app): add app-routing.module --- src/app/app-routing.module.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/app/app-routing.module.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts new file mode 100644 index 0000000..b12dc80 --- /dev/null +++ b/src/app/app-routing.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { FaqComponent } from '@pages/faq/faq.component'; +import { MainComponent } from '@pages/main/main.component'; + +const routes: Routes = [ + { path: '', component: MainComponent }, + { path: 'faq', component: FaqComponent }, + { + path: '**', + redirectTo: '', + }, +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule], +}) +export class AppRoutingModule {} From 05fb2fbc342aff08ce23ea320638028f902bf3a4 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:36:52 +0200 Subject: [PATCH 02/15] feat(pages): add faq page --- src/app/pages/faq/faq.component.css | 24 +++++++++++ src/app/pages/faq/faq.component.html | 60 ++++++++++++++++++++++++++++ src/app/pages/faq/faq.component.ts | 8 ++++ src/app/pages/faq/faq.module.ts | 16 ++++++++ 4 files changed, 108 insertions(+) create mode 100644 src/app/pages/faq/faq.component.css create mode 100644 src/app/pages/faq/faq.component.html create mode 100644 src/app/pages/faq/faq.component.ts create mode 100644 src/app/pages/faq/faq.module.ts diff --git a/src/app/pages/faq/faq.component.css b/src/app/pages/faq/faq.component.css new file mode 100644 index 0000000..829aac7 --- /dev/null +++ b/src/app/pages/faq/faq.component.css @@ -0,0 +1,24 @@ +h6 { + color: #c10707; + font-size: 20px; +} + +a { + color: #c10707; +} + +.text-container { + margin-left: 15%; + margin-right: 15%; + color: #333; +} + +.text-content { + font-weight: 400; + line-height: 1.5; + font-size: 16px; +} + +.question { + margin: 20px; +} diff --git a/src/app/pages/faq/faq.component.html b/src/app/pages/faq/faq.component.html new file mode 100644 index 0000000..8e41156 --- /dev/null +++ b/src/app/pages/faq/faq.component.html @@ -0,0 +1,60 @@ +
+
+
+
What is Angular-Communities?
+

+ Angular-communities in an initiative born in Málaga, Spain. It started as a small + open-source project built by four Angular devs from Málaga (see about us for more info) who + aimed to create a space where every single Angular community out there could be found and + located on the world map. This way, the visibility of all the Angular communities around the + world is increased, which is always a good thing! As more and more community members started + to show interest in Angular-Communities, our small project began to grow. Our goal now is to + create a space where all information regarding Angular can be found: communities, + conferences, events... +

+
+
+
I host an Angular community, can I add it to Angular-Communities?
+

Of course! We're looking forwards to adding your community.

+
+
+
Can Angular conferences/events like ngSpain, ngConf etc. be added too?
+

+ We're working on also adding all the Angular events! Would you like to help us out? You can + find more information + here. +

+
+
+
How do I add my community to Angular-Communities?
+

+ All you need to do is open a PR, filling in the required fields with the information about + your community. We'll review it, and if all is well, your community will be added! For more + info, see + the Angular-Communities README. +

+
+
+
Can I participate in the Angular-Communities project?
+

+ Of course you can! Any help at all is very welcome. See the following question for + information on how to contribute. +

+
+
+
How can I contribute to the Angular-Communities project?
+

+ You can find all the information related to contributing + here. +

+
+
+
diff --git a/src/app/pages/faq/faq.component.ts b/src/app/pages/faq/faq.component.ts new file mode 100644 index 0000000..4413457 --- /dev/null +++ b/src/app/pages/faq/faq.component.ts @@ -0,0 +1,8 @@ +import { Component } from "@angular/core"; + +@Component({ + selector: "app-faq", + templateUrl: "./faq.component.html", + styleUrls: ["./faq.component.css"] +}) +export class FaqComponent {} diff --git a/src/app/pages/faq/faq.module.ts b/src/app/pages/faq/faq.module.ts new file mode 100644 index 0000000..1b68560 --- /dev/null +++ b/src/app/pages/faq/faq.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { SharedModule } from '@shared/shared.module'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatInputModule } from '@angular/material/input'; +import { FaqComponent } from './faq.component'; + +const COMPONENTS = [FaqComponent]; + +@NgModule({ + declarations: [...COMPONENTS], + imports: [CommonModule, SharedModule, FlexLayoutModule, ReactiveFormsModule, MatInputModule], + exports: [...COMPONENTS], +}) +export class FaqModule {} From 44174508fa34a5ecb3af4b608d1438f42b8509d1 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:38:50 +0200 Subject: [PATCH 03/15] refactor(app.component): remove communities logic --- src/app/app.component.html | 7 +------ src/app/app.component.ts | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 3a095a0..f2a400e 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -11,11 +11,6 @@ gdColumns.xs="100% 100% " > - - + diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 93e2342..d1a3586 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,8 +5,4 @@ import { CommunityService } from '@shared/services'; selector: 'ngcommunity-root', templateUrl: './app.component.html', }) -export class AppComponent { - communitie$ = this.communityService.communities; - - constructor(private communityService: CommunityService) {} -} +export class AppComponent {} From 2e3bba53b7ef4b2d096aab0d45b801b1e169f7c5 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:47:29 +0200 Subject: [PATCH 04/15] feat(app.module): import AppRoutingModule --- src/app/app.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4123a0d..31cd3d4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,9 +4,9 @@ import { HttpClientModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; import { PagesModule } from './pages/pages.module'; import { SharedModule } from './shared/shared.module'; -import { RouterModule } from '@angular/router'; import { ServiceWorkerModule } from '@angular/service-worker'; import { environment } from '../environments/environment'; +import { AppRoutingModule } from './app-routing.module'; @NgModule({ declarations: [AppComponent], @@ -15,8 +15,8 @@ import { environment } from '../environments/environment'; SharedModule, PagesModule, HttpClientModule, - RouterModule.forRoot([]), ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), + AppRoutingModule, ], providers: [], bootstrap: [AppComponent], From f50d25411d62f73d0903dbd18cbaa5ccf778c23f Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:47:59 +0200 Subject: [PATCH 05/15] feat(main.component): add communities logic --- src/app/pages/main/main.component.html | 1 + src/app/pages/main/main.component.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/pages/main/main.component.html b/src/app/pages/main/main.component.html index 167c459..1b9e073 100644 --- a/src/app/pages/main/main.component.html +++ b/src/app/pages/main/main.component.html @@ -14,6 +14,7 @@ gdColumns.xs="100% auto" gdRows.xs="35% 65%" fxFlexFill + *ngIf="communitie$ | async as communities" > this.communitie$[community])); - community$ = this.route.fragment.pipe(map(community => this.communities[community])); - - constructor(private router: Router, private route: ActivatedRoute) {} + constructor( + private router: Router, + private route: ActivatedRoute, + private communityService: CommunityService, + ) { + console.log(this.communitie$); + } changeCommunity(community?: Community) { this.router.navigate([], { From 370214d52593e1d004a59dac373cb056adc6d7e2 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:49:37 +0200 Subject: [PATCH 06/15] feat(pages.module): import FaqModule --- src/app/pages/pages.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index 3197af6..52e3ad5 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -1,11 +1,12 @@ import { NgModule } from '@angular/core'; import { MainModule } from './main/main.module'; +import { FaqModule } from './faq/faq.module'; import { SharedModule } from '../shared/shared.module'; @NgModule({ declarations: [], - imports: [SharedModule, MainModule], + imports: [SharedModule, MainModule, FaqModule], providers: [], exports: [MainModule], }) From 00efe59366315ac5019c85fbdbe2bdfd611021d9 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:49:59 +0200 Subject: [PATCH 07/15] feat(shared.module): import RouterModule --- src/app/shared/shared.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 3d41181..caa4bc5 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -23,6 +23,7 @@ import { MatSnackBarModule } from '@angular/material/snack-bar'; import { MatToolbarModule } from '@angular/material/toolbar'; import { NgModule } from '@angular/core'; import { ScrollingModule } from '@angular/cdk/scrolling'; +import { RouterModule } from '@angular/router'; const CORE_MODULES = [BrowserAnimationsModule, CommonModule, FormsModule, ReactiveFormsModule]; @@ -49,7 +50,7 @@ const MATERIAL_MODULES = [ @NgModule({ declarations: COMPONENTS, - imports: [MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule], + imports: [MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule, RouterModule], exports: [COMPONENTS, MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule], }) export class SharedModule {} From 1f5f8799658882e6f0da6c31c9dc497e47ec163b Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Wed, 24 Jun 2020 18:50:41 +0200 Subject: [PATCH 08/15] feat(header.component): add styles and routing --- src/app/shared/components/header/header.component.html | 3 ++- src/app/shared/components/header/header.component.scss | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/shared/components/header/header.component.html b/src/app/shared/components/header/header.component.html index 0e7ef94..584ea30 100644 --- a/src/app/shared/components/header/header.component.html +++ b/src/app/shared/components/header/header.component.html @@ -6,9 +6,10 @@ alt="Angular communities logo" src="assets/images/angular-communities-logo_md.png" /> - ANGULAR COMMUNITIES + ANGULAR COMMUNITIES
+ FAQ Date: Fri, 26 Jun 2020 13:28:58 +0200 Subject: [PATCH 09/15] refactor(main.component): remove console.log --- src/app/pages/main/main.component.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index 97f4b3c..ac72ddf 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -19,9 +19,7 @@ export class MainComponent { private router: Router, private route: ActivatedRoute, private communityService: CommunityService, - ) { - console.log(this.communitie$); - } + ) {} changeCommunity(community?: Community) { this.router.navigate([], { From 32a3833ec124bc2578862144fd23d2dc917fa0b5 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Fri, 26 Jun 2020 13:33:16 +0200 Subject: [PATCH 10/15] refactor(faq.module): remove unused modules --- src/app/pages/faq/faq.module.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/pages/faq/faq.module.ts b/src/app/pages/faq/faq.module.ts index 1b68560..b5a1525 100644 --- a/src/app/pages/faq/faq.module.ts +++ b/src/app/pages/faq/faq.module.ts @@ -2,15 +2,13 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { SharedModule } from '@shared/shared.module'; import { FlexLayoutModule } from '@angular/flex-layout'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatInputModule } from '@angular/material/input'; import { FaqComponent } from './faq.component'; const COMPONENTS = [FaqComponent]; @NgModule({ - declarations: [...COMPONENTS], - imports: [CommonModule, SharedModule, FlexLayoutModule, ReactiveFormsModule, MatInputModule], - exports: [...COMPONENTS], + declarations: [COMPONENTS], + imports: [CommonModule, SharedModule, FlexLayoutModule], + exports: [COMPONENTS], }) export class FaqModule {} From 65e0b605442760ac49ee59fa677d288a24088dc4 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Fri, 26 Jun 2020 13:54:08 +0200 Subject: [PATCH 11/15] fix(main.component): adapt code to consider that communitie$ is an observable --- src/app/pages/main/main.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index ac72ddf..817733b 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -1,7 +1,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { Community, Communities } from '@shared/interfaces'; import { Component, Input } from '@angular/core'; -import { map } from 'rxjs/operators'; +import { map, withLatestFrom } from 'rxjs/operators'; import { CommunityService } from '@shared/services'; @Component({ @@ -11,9 +11,11 @@ import { CommunityService } from '@shared/services'; }) export class MainComponent { @Input() - /* communities: Communities; */ communitie$ = this.communityService.communities; - community$ = this.route.fragment.pipe(map(community => this.communitie$[community])); + community$ = this.route.fragment.pipe( + withLatestFrom(this.communitie$), + map(([community, communities]) => communities[community]), + ); constructor( private router: Router, From f4afebb93ebb03ffae96aa29fd2ecc3c4724b926 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Fri, 26 Jun 2020 13:54:42 +0200 Subject: [PATCH 12/15] refactor(community.service): add shareReplay(1) to avoid multiple requests --- src/app/shared/services/community.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/shared/services/community.service.ts b/src/app/shared/services/community.service.ts index 475eaf5..7b68a4f 100644 --- a/src/app/shared/services/community.service.ts +++ b/src/app/shared/services/community.service.ts @@ -2,7 +2,7 @@ import { Communities } from '@shared/interfaces'; import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { map, shareReplay } from 'rxjs/operators'; @Injectable({ providedIn: 'root', @@ -13,9 +13,10 @@ export class CommunityService { constructor(private httpClient: HttpClient) {} get communities(): Observable { - return this.httpClient - .get(this.JSON_COMMUNITIES) - .pipe(map(communities => this.normalizeCommunities(communities))); + return this.httpClient.get(this.JSON_COMMUNITIES).pipe( + map(communities => this.normalizeCommunities(communities)), + shareReplay(1), + ); } private normalizeCommunities(communities: Communities): Communities { From 3adca70f9665a3c6e84034ccc6615ca5ba51ac11 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Sat, 27 Jun 2020 12:36:25 +0200 Subject: [PATCH 13/15] fix(community.service): change getter to communitie$ property --- src/app/shared/services/community.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/shared/services/community.service.ts b/src/app/shared/services/community.service.ts index 7b68a4f..350b4df 100644 --- a/src/app/shared/services/community.service.ts +++ b/src/app/shared/services/community.service.ts @@ -12,12 +12,12 @@ export class CommunityService { constructor(private httpClient: HttpClient) {} - get communities(): Observable { - return this.httpClient.get(this.JSON_COMMUNITIES).pipe( + communitie$: Observable = this.httpClient + .get(this.JSON_COMMUNITIES) + .pipe( map(communities => this.normalizeCommunities(communities)), shareReplay(1), ); - } private normalizeCommunities(communities: Communities): Communities { const communitiesNormalized = Object.entries(communities) From 0704bc41b7caddbee231b53001e1379f31894438 Mon Sep 17 00:00:00 2001 From: Nya Garcia Date: Sat, 27 Jun 2020 12:37:00 +0200 Subject: [PATCH 14/15] feat(main.component): access community service communitie$ property --- src/app/pages/main/main.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index 817733b..860efe2 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -1,5 +1,5 @@ import { ActivatedRoute, Router } from '@angular/router'; -import { Community, Communities } from '@shared/interfaces'; +import { Community } from '@shared/interfaces'; import { Component, Input } from '@angular/core'; import { map, withLatestFrom } from 'rxjs/operators'; import { CommunityService } from '@shared/services'; @@ -11,7 +11,7 @@ import { CommunityService } from '@shared/services'; }) export class MainComponent { @Input() - communitie$ = this.communityService.communities; + communitie$ = this.communityService.communitie$; community$ = this.route.fragment.pipe( withLatestFrom(this.communitie$), map(([community, communities]) => communities[community]), From 066f28b7a4abad3a35aaf276aa34e7689c72c132 Mon Sep 17 00:00:00 2001 From: Carlos Caballero Date: Sun, 6 Jun 2021 19:17:30 +0200 Subject: [PATCH 15/15] feat(faq): Lazy-loading --- package.json | 2 +- src/app/app-routing.module.ts | 12 ++++++++---- src/app/app.module.ts | 9 ++++----- src/app/pages/faq/faq-routing.module.ts | 16 ++++++++++++++++ src/app/pages/faq/faq.module.ts | 5 ++--- src/app/pages/main/main-routing.module.ts | 16 ++++++++++++++++ src/app/pages/main/main.module.ts | 3 ++- src/app/pages/pages.module.ts | 13 ------------- src/app/shared/shared.module.ts | 6 ++---- 9 files changed, 51 insertions(+), 31 deletions(-) create mode 100644 src/app/pages/faq/faq-routing.module.ts create mode 100644 src/app/pages/main/main-routing.module.ts delete mode 100644 src/app/pages/pages.module.ts diff --git a/package.json b/package.json index 3526615..de326f1 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "private": true, "dependencies": { "@angular/animations": "~9.1.1", - "@angular/cdk": "^9.2.1", + "@angular/cdk": "^9.1.1", "@angular/common": "~9.1.1", "@angular/compiler": "~9.1.1", "@angular/core": "~9.1.1", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index b12dc80..c8bb3b2 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,11 +1,15 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { FaqComponent } from '@pages/faq/faq.component'; -import { MainComponent } from '@pages/main/main.component'; const routes: Routes = [ - { path: '', component: MainComponent }, - { path: 'faq', component: FaqComponent }, + { + path: '', + loadChildren: () => import('./pages/main/main.module').then(m => m.MainModule) + }, + { + path: 'faq', + loadChildren: () => import('./pages/faq/faq.module').then(m => m.FaqModule) + }, { path: '**', redirectTo: '', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 31cd3d4..710d463 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,20 +1,19 @@ import { AppComponent } from './app.component'; -import { BrowserModule } from '@angular/platform-browser'; import { HttpClientModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; -import { PagesModule } from './pages/pages.module'; import { SharedModule } from './shared/shared.module'; import { ServiceWorkerModule } from '@angular/service-worker'; import { environment } from '../environments/environment'; import { AppRoutingModule } from './app-routing.module'; +import { CommonModule } from '@angular/common'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +const CORE_MODULE = [CommonModule, BrowserAnimationsModule, HttpClientModule]; @NgModule({ declarations: [AppComponent], imports: [ - BrowserModule, + CORE_MODULE, SharedModule, - PagesModule, - HttpClientModule, ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), AppRoutingModule, ], diff --git a/src/app/pages/faq/faq-routing.module.ts b/src/app/pages/faq/faq-routing.module.ts new file mode 100644 index 0000000..0455aaf --- /dev/null +++ b/src/app/pages/faq/faq-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { FaqComponent } from './faq.component'; + +const routes: Routes = [ + { + path: '', + component: FaqComponent, + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class FaqRoutingModule {} diff --git a/src/app/pages/faq/faq.module.ts b/src/app/pages/faq/faq.module.ts index b5a1525..693a071 100644 --- a/src/app/pages/faq/faq.module.ts +++ b/src/app/pages/faq/faq.module.ts @@ -1,14 +1,13 @@ import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { SharedModule } from '@shared/shared.module'; import { FlexLayoutModule } from '@angular/flex-layout'; import { FaqComponent } from './faq.component'; +import { FaqRoutingModule } from './faq-routing.module'; const COMPONENTS = [FaqComponent]; @NgModule({ declarations: [COMPONENTS], - imports: [CommonModule, SharedModule, FlexLayoutModule], + imports: [FaqRoutingModule, FlexLayoutModule], exports: [COMPONENTS], }) export class FaqModule {} diff --git a/src/app/pages/main/main-routing.module.ts b/src/app/pages/main/main-routing.module.ts new file mode 100644 index 0000000..54b6264 --- /dev/null +++ b/src/app/pages/main/main-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { MainComponent } from './main.component'; + +const routes: Routes = [ + { + path: '', + component: MainComponent, + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class MainRoutingModule {} diff --git a/src/app/pages/main/main.module.ts b/src/app/pages/main/main.module.ts index cf71b43..a3568f2 100644 --- a/src/app/pages/main/main.module.ts +++ b/src/app/pages/main/main.module.ts @@ -5,12 +5,13 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '@shared/shared.module'; import { SidenavComponent } from './components/sidenav/sidenav.component'; import { CommunityPreviewComponent } from './components/community-preview/community-preview.component'; +import { MainRoutingModule } from './main-routing.module'; const COMPONENTS = [MainComponent, MapComponent, SidenavComponent, CommunityPreviewComponent]; @NgModule({ declarations: COMPONENTS, - imports: [SharedModule, GoogleMapsModule], + imports: [MainRoutingModule, SharedModule, GoogleMapsModule], providers: [], exports: COMPONENTS, }) diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts deleted file mode 100644 index 52e3ad5..0000000 --- a/src/app/pages/pages.module.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NgModule } from '@angular/core'; - -import { MainModule } from './main/main.module'; -import { FaqModule } from './faq/faq.module'; -import { SharedModule } from '../shared/shared.module'; - -@NgModule({ - declarations: [], - imports: [SharedModule, MainModule, FaqModule], - providers: [], - exports: [MainModule], -}) -export class PagesModule {} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 3c508b7..d9deaa0 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -1,6 +1,5 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { CommonModule } from '@angular/common'; import { CommunityItemComponent } from './components/community-item/community-item.component'; import { FlexLayoutModule } from '@angular/flex-layout'; @@ -26,7 +25,6 @@ import { ScrollingModule } from '@angular/cdk/scrolling'; import { RouterModule } from '@angular/router'; import { ClipboardModule } from '@angular/cdk/clipboard'; -const CORE_MODULES = [BrowserAnimationsModule, CommonModule, FormsModule, ReactiveFormsModule]; const COMPONENTS = [FooterComponent, HeaderComponent, CommunityItemComponent]; @@ -52,7 +50,7 @@ const MATERIAL_MODULES = [ @NgModule({ declarations: COMPONENTS, - imports: [MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule, RouterModule], - exports: [COMPONENTS, MATERIAL_MODULES, CORE_MODULES, FlexLayoutModule], + imports: [MATERIAL_MODULES, CommonModule, ReactiveFormsModule, FlexLayoutModule, RouterModule], + exports: [COMPONENTS, MATERIAL_MODULES, CommonModule, ReactiveFormsModule, FlexLayoutModule], }) export class SharedModule {}