Implements Lazy Loading
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { HomeComponent } from './home/home.component';
|
|
||||||
import { CallbackComponent } from './header/header-popup/callback/callback.component';
|
import { CallbackComponent } from './header/header-popup/callback/callback.component';
|
||||||
import {ProjectsComponent} from "./projects/projects.component";
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -13,11 +12,11 @@ const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'home',
|
path: 'home',
|
||||||
component: HomeComponent,
|
loadChildren: () => import('./home/home.module').then(mod => mod.HomeModule),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'projects',
|
path: 'projects',
|
||||||
component: ProjectsComponent,
|
loadChildren: () => import('./projects/projects.module').then(mod => mod.ProjectsModule),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'callback',
|
path: 'callback',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { AuthService } from './shared/auth/auth.service';
|
import { AuthService } from './shared/service/auth.service';
|
||||||
import { UpdateService } from './shared/service-worker/update.service';
|
import { UpdateService } from './shared/service-worker/update.service';
|
||||||
import {
|
import {
|
||||||
NgcCookieConsentService,
|
NgcCookieConsentService,
|
||||||
|
|||||||
@@ -10,16 +10,12 @@ import { AppServiceWorkerModule } from './app-service-worker.module';
|
|||||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||||
import { environment } from '../environments/environment';
|
import { environment } from '../environments/environment';
|
||||||
import { FooterComponent } from './footer/footer.component';
|
import { FooterComponent } from './footer/footer.component';
|
||||||
import {HomeModule} from "./home/home.module";
|
|
||||||
import {ProjectsModule} from "./projects/projects.module";
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AppComponent, FooterComponent],
|
declarations: [AppComponent, FooterComponent],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
HeaderModule,
|
HeaderModule,
|
||||||
HomeModule,
|
|
||||||
ProjectsModule,
|
|
||||||
AppRouterModule,
|
AppRouterModule,
|
||||||
AppServiceWorkerModule,
|
AppServiceWorkerModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
faUser,
|
faUser,
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/service/auth.service';
|
||||||
import { User } from '../../shared/model/user/user.model';
|
import { User } from '../../shared/model/user/user.model';
|
||||||
import UserChecker from '../../shared/model/user/user.checker';
|
import UserChecker from '../../shared/model/user/user.checker';
|
||||||
import { HelpComponent } from '../header-popup/help/help.component';
|
import { HelpComponent } from '../header-popup/help/help.component';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/service/auth.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-callback',
|
selector: 'app-callback',
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { MatIconRegistry } from '@angular/material/icon';
|
|||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { faLock, faUser } from '@fortawesome/free-solid-svg-icons';
|
import { faLock, faUser } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/service/auth.service';
|
||||||
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
||||||
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
||||||
import UserChecker from 'src/app/shared/model/user/user.checker';
|
import UserChecker from 'src/app/shared/model/user/user.checker';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
Output,
|
Output,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { AuthService } from '../../../shared/auth/auth.service';
|
import { AuthService } from '../../../shared/service/auth.service';
|
||||||
import { User } from '../../../shared/model/user/user.model';
|
import { User } from '../../../shared/model/user/user.model';
|
||||||
import {
|
import {
|
||||||
animate,
|
animate,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, EventEmitter, Output } from '@angular/core';
|
import { Component, EventEmitter, Output } from '@angular/core';
|
||||||
import { AuthService } from '../../../../shared/auth/auth.service';
|
import { AuthService } from '../../../../shared/service/auth.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-profile-picture-picker',
|
selector: 'app-profile-picture-picker',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
faUser,
|
faUser,
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/service/auth.service';
|
||||||
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
||||||
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
||||||
import UserChecker from 'src/app/shared/model/user/user.checker';
|
import UserChecker from 'src/app/shared/model/user/user.checker';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { faUser } from '@fortawesome/free-solid-svg-icons';
|
|||||||
import { SliderItemComponent } from 'src/app/shared/components/slider-item/slider-item.component';
|
import { SliderItemComponent } from 'src/app/shared/components/slider-item/slider-item.component';
|
||||||
import UserChecker from '../../../shared/model/user/user.checker';
|
import UserChecker from '../../../shared/model/user/user.checker';
|
||||||
import { User } from '../../../shared/model/user/user.model';
|
import { User } from '../../../shared/model/user/user.model';
|
||||||
import { AuthService } from '../../../shared/auth/auth.service';
|
import { AuthService } from '../../../shared/service/auth.service';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/service/auth.service';
|
||||||
import { SliderItemComponent } from 'src/app/shared/components/slider-item/slider-item.component';
|
import { SliderItemComponent } from 'src/app/shared/components/slider-item/slider-item.component';
|
||||||
import UserChecker from 'src/app/shared/model/user/user.checker';
|
import UserChecker from 'src/app/shared/model/user/user.checker';
|
||||||
import { User } from 'src/app/shared/model/user/user.model';
|
import { User } from 'src/app/shared/model/user/user.model';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { LoginComponent } from './header-popup/login/login.component';
|
import { LoginComponent } from './header-popup/login/login.component';
|
||||||
import { SignupComponent } from './header-popup/signup/signup.component';
|
import { SignupComponent } from './header-popup/signup/signup.component';
|
||||||
import { AuthService } from '../shared/auth/auth.service';
|
import { AuthService } from '../shared/service/auth.service';
|
||||||
import UserChecker from '../shared/model/user/user.checker';
|
import UserChecker from '../shared/model/user/user.checker';
|
||||||
import { User } from '../shared/model/user/user.model';
|
import { User } from '../shared/model/user/user.model';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
|||||||
18
src/app/home/home-router.module.ts
Normal file
18
src/app/home/home-router.module.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import {HomeComponent} from "./home.component";
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: HomeComponent,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [],
|
||||||
|
imports: [CommonModule, RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class HomeRouterModule {}
|
||||||
@@ -4,6 +4,7 @@ import {HomeComponent} from "./home.component";
|
|||||||
import {StackSliderComponent} from "./stack-slider/stack-slider.component";
|
import {StackSliderComponent} from "./stack-slider/stack-slider.component";
|
||||||
import {StackCardComponent} from "./stack-slider/stack-card/stack-card.component";
|
import {StackCardComponent} from "./stack-slider/stack-card/stack-card.component";
|
||||||
import {NgxGlideComponent} from "ngx-glide";
|
import {NgxGlideComponent} from "ngx-glide";
|
||||||
|
import {HomeRouterModule} from "./home-router.module";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +17,8 @@ import {NgxGlideComponent} from "ngx-glide";
|
|||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
NgxGlideComponent,
|
NgxGlideComponent,
|
||||||
NgOptimizedImage
|
NgOptimizedImage,
|
||||||
|
HomeRouterModule
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class HomeModule { }
|
export class HomeModule { }
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { ProjectCardComponent } from './project-card.component';
|
|
||||||
|
|
||||||
describe('ProjectCardComponent', () => {
|
|
||||||
let component: ProjectCardComponent;
|
|
||||||
let fixture: ComponentFixture<ProjectCardComponent>;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ProjectCardComponent]
|
|
||||||
});
|
|
||||||
fixture = TestBed.createComponent(ProjectCardComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
import {Component, HostListener, Input, OnInit, ViewChild} from '@angular/core';
|
import {Component, HostListener, Input, OnInit, ViewChild} from '@angular/core';
|
||||||
import { faCodeFork, faEye, faStar } from '@fortawesome/free-solid-svg-icons';
|
import {faCodeFork, faEye, faScaleBalanced, faStar} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {Language, Project} from "../../shared/model/project/project.model";
|
import {Language, Project} from "../../shared/model/project/project.model";
|
||||||
import {faScaleBalanced} from "@fortawesome/free-solid-svg-icons/faScaleBalanced";
|
|
||||||
import {
|
import {
|
||||||
ApexAnnotations,
|
|
||||||
ApexChart, ApexDataLabels,
|
ApexChart, ApexDataLabels,
|
||||||
ApexNonAxisChartSeries,
|
ApexNonAxisChartSeries,
|
||||||
ApexPlotOptions,
|
ApexPlotOptions,
|
||||||
|
|||||||
18
src/app/projects/projects-router.module.ts
Normal file
18
src/app/projects/projects-router.module.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import {ProjectsComponent} from "./projects.component";
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ProjectsComponent
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [],
|
||||||
|
imports: [CommonModule, RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class ProjectsRouterModule {}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { ProjectsComponent } from './projects.component';
|
|
||||||
|
|
||||||
describe('ProjectsComponent', () => {
|
|
||||||
let component: ProjectsComponent;
|
|
||||||
let fixture: ComponentFixture<ProjectsComponent>;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ProjectsComponent]
|
|
||||||
});
|
|
||||||
fixture = TestBed.createComponent(ProjectsComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {GithubService} from "../shared/github-service/github.service";
|
import {GithubService} from "../shared/service/github.service";
|
||||||
import {Project} from "../shared/model/project/project.model";
|
import {Project} from "../shared/model/project/project.model";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { ProjectCardComponent } from './project-card/project-card.component';
|
|||||||
import {MatIconModule} from "@angular/material/icon";
|
import {MatIconModule} from "@angular/material/icon";
|
||||||
import {FontAwesomeModule} from "@fortawesome/angular-fontawesome";
|
import {FontAwesomeModule} from "@fortawesome/angular-fontawesome";
|
||||||
import {NgApexchartsModule} from "ng-apexcharts";
|
import {NgApexchartsModule} from "ng-apexcharts";
|
||||||
|
import {ProjectsRouterModule} from "./projects-router.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@@ -16,7 +17,8 @@ import {NgApexchartsModule} from "ng-apexcharts";
|
|||||||
NgOptimizedImage,
|
NgOptimizedImage,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
NgApexchartsModule
|
NgApexchartsModule,
|
||||||
|
ProjectsRouterModule
|
||||||
],
|
],
|
||||||
exports: []
|
exports: []
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { GithubServiceService } from './github.service';
|
|
||||||
|
|
||||||
describe('GithubServiceService', () => {
|
|
||||||
let service: GithubServiceService;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
TestBed.configureTestingModule({});
|
|
||||||
service = TestBed.inject(GithubServiceService);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be created', () => {
|
|
||||||
expect(service).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user