Skip to content

feat: add landing page #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 182 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
"@angular/platform-browser": "^16.1.0",
"@angular/platform-browser-dynamic": "^16.1.0",
"@angular/router": "^16.1.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"chart.js": "^4.4.0",
"primeflex": "^3.3.1",
"primeicons": "^6.0.1",
"primeng": "^16.7.0",
"primeng": "^16.7.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
Expand All @@ -37,6 +39,7 @@
"@angular-eslint/template-parser": "16.1.0",
"@angular/cli": "~16.1.5",
"@angular/compiler-cli": "^16.1.0",
"@angular/localize": "^16.2.0",
"@types/jasmine": "~4.3.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
Expand Down
20 changes: 16 additions & 4 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [
RouterModule.forRoot(
[
{
path: '',
loadChildren: () => import('./features/landing/landing.module').then((m) => m.default),
},
],
{
scrollPositionRestoration: 'enabled',
anchorScrolling: 'enabled',
onSameUrlNavigation: 'reload',
},
),
],
exports: [RouterModule],
})
export default class AppRoutingModule {}
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<h1>Sample angular app</h1>
<router-outlet></router-outlet>
26 changes: 23 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { PrimeNGConfig } from 'primeng/api';
import LanguageService from './shared/services/language.service';
import LANGUAGES from './shared/constants/language.constants';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
})
export default class AppComponent {
title = 'sample-angular-app';
export default class AppComponent implements OnInit {
// eslint-disable-next-line no-useless-constructor, no-empty-function
constructor(private primengConfig: PrimeNGConfig, private translateService: TranslateService, private languageService: LanguageService) { }

ngOnInit() {
this.initializePrimeNgConfigs();
this.initializeAppLanguage();
}

initializePrimeNgConfigs() {
this.primengConfig.ripple = true;
}

initializeAppLanguage() {
this.translateService.setDefaultLang(LANGUAGES.ENGLISH);
const currentLanguage = this.languageService.getCurrentLanguage();
this.translateService.use(currentLanguage.code || LANGUAGES.ENGLISH);
}
}
21 changes: 16 additions & 5 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import AppRoutingModule from './app-routing.module';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { HttpClient } from '@angular/common/http';
import HttpLoaderFactory from 'src/assets/i18n/loader';
import AppComponent from './app.component';
import AppRoutingModule from './app-routing.module';

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AppRoutingModule],
providers: [],
imports: [
AppRoutingModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient],
},
}),
],
providers: [{ provide: LocationStrategy, useClass: HashLocationStrategy }],
bootstrap: [AppComponent],
})
export default class AppModule {}
Loading