diff --git a/src/app/app-navigation.ts b/src/app/app-navigation.ts
new file mode 100644
index 000000000..6c89cc46e
--- /dev/null
+++ b/src/app/app-navigation.ts
@@ -0,0 +1,18 @@
+export const navigation = [
+ {
+ text: 'Home',
+ path: '/home',
+ icon: 'home',
+ items: [{
+ text: 'Profile',
+ path: '/profile'
+ }, {
+ text: 'Settings',
+ path: '/settings'
+ }]
+ }, {
+ text: 'About',
+ path: '/about',
+ icon: 'info'
+ }
+];
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 22d1d1f4a..ca718fad1 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -5,23 +5,20 @@ import { ProfileComponent } from './pages/profile/profile.component';
import { SettingsComponent } from './pages/settings/settings.component';
import { AboutComponent } from './pages/about/about.component'
-const routes: Routes = [{
- path: '',
- redirectTo: 'profile',
- pathMatch: 'full'
- }, {
- path: 'profile',
- component: ProfileComponent,
- data: { title: 'Profile' }
- }, {
- path: 'settings',
- component: SettingsComponent,
- data: { title: 'Settings' }
- }, {
- path: 'about',
- component: AboutComponent,
- data: { title: 'About' }
- }
+export const routes: Routes = [{
+ path: '',
+ redirectTo: 'profile',
+ pathMatch: 'full'
+ }, {
+ path: 'profile',
+ component: ProfileComponent
+ }, {
+ path: 'settings',
+ component: SettingsComponent
+ }, {
+ path: 'about',
+ component: AboutComponent
+ }
];
@NgModule({
diff --git a/src/app/layout/layout.component.html b/src/app/layout/layout.component.html
index 2d2e7f0d8..bdf8ac9c0 100644
--- a/src/app/layout/layout.component.html
+++ b/src/app/layout/layout.component.html
@@ -1,6 +1,6 @@
diff --git a/src/app/services/navigation/navigation.service.spec.ts b/src/app/services/navigation/navigation.service.spec.ts
deleted file mode 100644
index 3d2693e64..000000000
--- a/src/app/services/navigation/navigation.service.spec.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { TestBed, inject } from '@angular/core/testing';
-
-import { NavigationService } from './navigation.service';
-
-describe('NavigationService', () => {
- beforeEach(() => {
- TestBed.configureTestingModule({
- providers: [NavigationService]
- });
- });
-
- it('should be created', inject([NavigationService], (service: NavigationService) => {
- expect(service).toBeTruthy();
- }));
-});
diff --git a/src/app/services/navigation/navigation.service.ts b/src/app/services/navigation/navigation.service.ts
deleted file mode 100644
index 830d189e2..000000000
--- a/src/app/services/navigation/navigation.service.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Injectable } from '@angular/core';
-
-export class Navigation {
- text: string;
- expanded?: boolean;
- icon?: string;
- path?: string;
- items?: any;
-}
-
-let navigationData: Navigation[] = [
- {
- "text": "Home",
- "expanded": true,
- "icon": "home",
- "items": [
- {
- "text": "Profile",
- "path": "profile"
- },
- {
- "text": "Settings",
- "path": "settings"
- }
- ]
- },
- {
- "text": "About",
- "icon": "info",
- "path": "about"
- }
-]
-
-@Injectable({
- providedIn: 'root'
-})
-export class NavigationService {
- getNavigationData() {
- return navigationData;
- }
-}
diff --git a/src/app/shared/components/navigation-menu/navigation-menu.component.html b/src/app/shared/components/navigation-menu/navigation-menu.component.html
index a151d7f1d..727d47379 100644
--- a/src/app/shared/components/navigation-menu/navigation-menu.component.html
+++ b/src/app/shared/components/navigation-menu/navigation-menu.component.html
@@ -1,6 +1,6 @@
diff --git a/src/app/shared/components/navigation-menu/navigation-menu.component.ts b/src/app/shared/components/navigation-menu/navigation-menu.component.ts
index 522020408..a97eb89e3 100644
--- a/src/app/shared/components/navigation-menu/navigation-menu.component.ts
+++ b/src/app/shared/components/navigation-menu/navigation-menu.component.ts
@@ -1,6 +1,6 @@
import { Component, NgModule, Output, EventEmitter } from '@angular/core';
import { DxTreeViewModule } from 'devextreme-angular/ui/tree-view';
-import { NavigationService, Navigation } from '../../../services/navigation/navigation.service';
+import { navigation } from '../../../app-navigation';
import { Router } from '@angular/router';
@Component({
@@ -11,17 +11,15 @@ import { Router } from '@angular/router';
display: block;
height: 100%;
}
- `],
- providers: [NavigationService]
+ `]
})
export class NavigationMenuComponent {
@Output() selectedItemChanged = new EventEmitter();
+ menuItems: any;
- menuItems: Navigation[];
-
- constructor(private router: Router, navigationService: NavigationService) {
- this.menuItems = navigationService.getNavigationData();
- }
+ constructor(private router: Router) {
+ this.menuItems = navigation;
+ }
onItemSelectionChanged(event) {
this.selectedItemChanged.emit(event.itemData.text);