moving to standalone done.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Route } from '@angular/router';
|
||||
import { AuthGuard } from './auth/auth.guard';
|
||||
import { LoginPageComponent } from './components/login-page/login-page.component';
|
||||
import { MainViewComponent } from './main-view/main-view.component';
|
||||
|
||||
const routes: Routes = [
|
||||
export const APP_ROUTES: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: LoginPageComponent,
|
||||
@@ -16,18 +15,12 @@ const routes: Routes = [
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('./modules/dashboard/dashboard.module').then(m => m.DashboardModule)
|
||||
loadChildren: () => import('./modules/dashboard/dashboard.routes').then(r => r.DASHBOARD_ROUTES)
|
||||
},
|
||||
{
|
||||
path: 'layers',
|
||||
loadChildren: () => import('./modules/layers/layers.module').then(m => m.LayersModule)
|
||||
loadChildren: () => import('./modules/layers/layers.routes').then(r=> r.LAYERS_ROUTES)
|
||||
},
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
];
|
||||
@@ -22,7 +22,8 @@ import { NgIf, DatePipe } from '@angular/common';
|
||||
templateUrl: './main-view.component.html',
|
||||
styleUrls: ['./main-view.component.scss'],
|
||||
standalone: true,
|
||||
imports: [NgIf, MatIconModule, MatToolbarModule, MatButtonModule, MatSidenavModule, MatListModule, RouterLink, MatDividerModule, RouterOutlet, DatePipe]
|
||||
imports: [NgIf, MatIconModule, MatToolbarModule, MatButtonModule, MatSidenavModule,
|
||||
MatListModule, RouterLink, MatDividerModule, RouterOutlet, DatePipe]
|
||||
})
|
||||
export class MainViewComponent {
|
||||
@ViewChild('snav') snav?: MatSidenav;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { BoardComponent } from './board/board.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: BoardComponent
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class DashboardRoutingModule { }
|
||||
@@ -1,15 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { DashboardRoutingModule } from './dashboard-routing.module';
|
||||
import { BoardComponent } from './board/board.component';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
DashboardRoutingModule,
|
||||
BoardComponent
|
||||
]
|
||||
})
|
||||
export class DashboardModule { }
|
||||
6
Frontend/src/app/modules/dashboard/dashboard.routes.ts
Normal file
6
Frontend/src/app/modules/dashboard/dashboard.routes.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Route } from "@angular/router";
|
||||
import { BoardComponent } from "./board/board.component";
|
||||
|
||||
export const DASHBOARD_ROUTES: Route[] = [
|
||||
{ path: '', component: BoardComponent },
|
||||
];
|
||||
@@ -22,7 +22,10 @@ import { MatCardModule } from '@angular/material/card';
|
||||
templateUrl: './layer-detail.component.html',
|
||||
styleUrls: ['./layer-detail.component.scss'],
|
||||
standalone: true,
|
||||
imports: [FormsModule, ReactiveFormsModule, MatCardModule, MatToolbarModule, MatButtonModule, MatGridListModule, MatFormFieldModule, MatInputModule, NgIf, MatTableModule, MatSortModule, DecimalPipe]
|
||||
imports: [FormsModule, ReactiveFormsModule, MatCardModule, MatToolbarModule,
|
||||
MatButtonModule, MatGridListModule, MatFormFieldModule, MatInputModule,
|
||||
NgIf, MatTableModule, MatSortModule, DecimalPipe],
|
||||
providers: [DatePipe]
|
||||
})
|
||||
export class LayerDetailComponent implements OnInit {
|
||||
|
||||
@@ -38,7 +41,6 @@ export class LayerDetailComponent implements OnInit {
|
||||
private fb$: UntypedFormBuilder,
|
||||
private http$: HttpClient,
|
||||
private route$: ActivatedRoute,
|
||||
private auth$: AuthService,
|
||||
private datePipe: DatePipe,
|
||||
private notifications$: NotificationsService
|
||||
) { }
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule, DatePipe } from '@angular/common';
|
||||
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { LayersListComponent } from './layers-list/layers-list.component';
|
||||
import { LayerEditComponent } from './layer-edit/layer-edit.component';
|
||||
import { LayerDetailComponent } from './layer-detail/layer-detail.component';
|
||||
import { LayersRoutingModule } from './layers-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
LayersRoutingModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
LayersListComponent,
|
||||
LayerEditComponent,
|
||||
LayerDetailComponent
|
||||
],
|
||||
providers: [
|
||||
DatePipe
|
||||
]
|
||||
})
|
||||
export class LayersModule { }
|
||||
@@ -1,17 +1,10 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Route } from '@angular/router';
|
||||
import { LayerDetailComponent } from './layer-detail/layer-detail.component';
|
||||
import { LayerEditComponent } from './layer-edit/layer-edit.component';
|
||||
import { LayersListComponent } from './layers-list/layers-list.component';
|
||||
|
||||
const routes: Routes = [
|
||||
export const LAYERS_ROUTES: Route[] = [
|
||||
{ path: '', component: LayersListComponent },
|
||||
{ path: 'Edit/:id', component: LayerEditComponent },
|
||||
{ path: 'Detail/:id', component: LayerDetailComponent }
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class LayersRoutingModule { }
|
||||
];
|
||||
@@ -3,7 +3,6 @@ import { environment } from './environments/environment';
|
||||
import { AppComponent } from './app/app.component';
|
||||
import { provideServiceWorker } from '@angular/service-worker';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
import { AppRoutingModule } from './app/app-routing.module';
|
||||
import { BrowserModule, bootstrapApplication } from '@angular/platform-browser';
|
||||
import { AuthInterceptor } from './app/interceptors/auth.interceptor';
|
||||
import { LoaderInterceptor } from './app/interceptors/loader.interceptor';
|
||||
@@ -12,7 +11,9 @@ import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/mat
|
||||
import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
|
||||
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
||||
import localePl from '@angular/common/locales/pl';
|
||||
import { registerLocaleData } from '@angular/common';
|
||||
import { DatePipe, registerLocaleData } from '@angular/common';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { APP_ROUTES } from './app/app.routes';
|
||||
registerLocaleData(localePl);
|
||||
|
||||
if (environment.production) {
|
||||
@@ -21,9 +22,9 @@ if (environment.production) {
|
||||
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
provideRouter(APP_ROUTES),
|
||||
importProvidersFrom(
|
||||
BrowserModule,
|
||||
AppRoutingModule,
|
||||
MatBottomSheetModule),
|
||||
{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS] },
|
||||
{ provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } },
|
||||
|
||||
Reference in New Issue
Block a user