@@ -42,7 +25,7 @@
diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts
index bb235f9..41cadba 100644
--- a/src/app/app.component.spec.ts
+++ b/src/app/app.component.spec.ts
@@ -4,9 +4,7 @@ import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [
- AppComponent
- ],
+ declarations: [AppComponent],
}).compileComponents();
}));
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 196cbf4..ea601b6 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -9,6 +9,8 @@ import { TranslocoRootModule } from './transloco-root.module';
import { ScoutingCryptoComponent } from './scouting-crypto/scouting-crypto.component';
import { HomeComponent } from './home-component/home.component';
import { RouterModule } from '@angular/router';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { MainNavigationComponent } from './main-navigation/main-navigation.component';
@NgModule({
imports: [
@@ -16,10 +18,11 @@ import { RouterModule } from '@angular/router';
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
+ NgbModule,
TranslocoRootModule,
RouterModule.forRoot([{ path: '', component: ScoutingCryptoComponent }]),
],
- declarations: [ScoutingCryptoComponent, HomeComponent, AppComponent],
+ declarations: [ScoutingCryptoComponent, HomeComponent, AppComponent, MainNavigationComponent],
providers: [],
bootstrap: [AppComponent],
})
diff --git a/src/app/main-navigation/main-navigation.component.css b/src/app/main-navigation/main-navigation.component.css
new file mode 100644
index 0000000..5a5419d
--- /dev/null
+++ b/src/app/main-navigation/main-navigation.component.css
@@ -0,0 +1,10 @@
+nav ul {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+}
+
+nav ul li {
+ display: inline;
+ margin-right: 1em;
+}
diff --git a/src/app/main-navigation/main-navigation.component.html b/src/app/main-navigation/main-navigation.component.html
new file mode 100644
index 0000000..1e6ddf3
--- /dev/null
+++ b/src/app/main-navigation/main-navigation.component.html
@@ -0,0 +1,30 @@
+
diff --git a/src/app/main-navigation/main-navigation.component.ts b/src/app/main-navigation/main-navigation.component.ts
new file mode 100644
index 0000000..ce0b743
--- /dev/null
+++ b/src/app/main-navigation/main-navigation.component.ts
@@ -0,0 +1,23 @@
+import { Component, ViewChild } from '@angular/core';
+import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
+
+@Component({
+ selector: 'app-main-navigation',
+ templateUrl: './main-navigation.component.html',
+ styleUrl: './main-navigation.component.css',
+})
+export class MainNavigationComponent {
+ @ViewChild('myDrop', { static: false }) myDrop: NgbDropdown;
+ private timeout: number;
+
+ onMouseEnter() {
+ clearTimeout(this.timeout);
+ this.myDrop.open();
+ }
+
+ onMouseLeave() {
+ this.timeout = setTimeout(() => {
+ this.myDrop.close();
+ }, 300); // Delay before closing helps if mouse moves to 1px gap for submenu
+ }
+}
diff --git a/src/app/transloco-root.module.ts b/src/app/transloco-root.module.ts
index 80e9a0f..dbd750e 100644
--- a/src/app/transloco-root.module.ts
+++ b/src/app/transloco-root.module.ts
@@ -5,7 +5,7 @@ import {
TranslocoLoader,
TRANSLOCO_CONFIG,
translocoConfig,
- TranslocoModule
+ TranslocoModule,
} from '@ngneat/transloco';
import { Injectable, NgModule } from '@angular/core';
import { environment } from '../environments/environment';
@@ -13,7 +13,7 @@ import { Observable } from 'rxjs';
@Injectable({ providedIn: 'root' })
export class TranslocoHttpLoader implements TranslocoLoader {
- constructor(private http: HttpClient) { }
+ constructor(private http: HttpClient) {}
getTranslation(lang: string): Observable {
return this.http.get(`/assets/i18n/${lang}.json`);
@@ -31,9 +31,9 @@ export class TranslocoHttpLoader implements TranslocoLoader {
// Remove this option if your application doesn't support changing language in runtime.
reRenderOnLangChange: true,
prodMode: environment.production,
- })
+ }),
},
- { provide: TRANSLOCO_LOADER, useClass: TranslocoHttpLoader }
- ]
+ { provide: TRANSLOCO_LOADER, useClass: TranslocoHttpLoader },
+ ],
})
-export class TranslocoRootModule { }
+export class TranslocoRootModule {}
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 3612073..c966979 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -1,3 +1,3 @@
export const environment = {
- production: true
+ production: true,
};
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 30d7bcc..31cb785 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -3,7 +3,7 @@
// The list of file replacements can be found in `angular.json`.
export const environment = {
- production: false
+ production: false,
};
/*
diff --git a/src/jestGlobalMocks.ts b/src/jestGlobalMocks.ts
index ccbc91e..85c6028 100644
--- a/src/jestGlobalMocks.ts
+++ b/src/jestGlobalMocks.ts
@@ -1,14 +1,14 @@
-Object.defineProperty(window, 'CSS', {value: null});
+Object.defineProperty(window, 'CSS', { value: null });
Object.defineProperty(document, 'doctype', {
- value: ''
+ value: '',
});
Object.defineProperty(window, 'getComputedStyle', {
value: () => {
return {
display: 'none',
- appearance: ['-webkit-appearance']
+ appearance: ['-webkit-appearance'],
};
- }
+ },
});
/**
* ISSUE: https://github.com/angular/material2/issues/7101
diff --git a/src/main.ts b/src/main.ts
index c7b673c..d9a2e7e 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -8,5 +8,6 @@ if (environment.production) {
enableProdMode();
}
-platformBrowserDynamic().bootstrapModule(AppModule)
- .catch(err => console.error(err));
+platformBrowserDynamic()
+ .bootstrapModule(AppModule)
+ .catch((err) => console.error(err));
diff --git a/transloco.config.js b/transloco.config.js
index b0d0435..06c4233 100644
--- a/transloco.config.js
+++ b/transloco.config.js
@@ -1,5 +1,5 @@
module.exports = {
- rootTranslationsPath: 'src/assets/i18n/',
- langs: ['de', 'en'],
- keysManager: {}
-};
\ No newline at end of file
+ rootTranslationsPath: "src/assets/i18n/",
+ langs: ["de", "en"],
+ keysManager: {},
+};
diff --git a/tsconfig.spec.json b/tsconfig.spec.json
index f675669..5108a1b 100644
--- a/tsconfig.spec.json
+++ b/tsconfig.spec.json
@@ -2,16 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
- "types": [
- "jest",
- "node"
- ]
+ "types": ["jest", "node"]
},
- "files": [
- "src/polyfills.ts"
- ],
- "include": [
- "src/**/*.spec.ts",
- "src/**/*.d.ts"
- ]
+ "files": ["src/polyfills.ts"],
+ "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
}