* specific language governing permissions and limitations
* under the License.
*/
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
-import { AboutComponent } from './modules/shared/about/about.component';
-import { ContactComponent } from './modules/shared/contact/contact.component';
-import { HomeComponent } from './modules/shared/home/home.component';
-import { NotFoundComponent } from './modules/shared/not-found/not-found.component';
-import { LoginComponent } from "./modules/shared/login/login.component";
-import { SearchComponent } from './modules/repo/search/search.component';
+import {AboutComponent} from './modules/shared/about/about.component';
+import {ContactComponent} from './modules/shared/contact/contact.component';
+import {HomeComponent} from './modules/shared/home/home.component';
+import {NotFoundComponent} from './modules/shared/not-found/not-found.component';
+import {LoginComponent} from "./modules/shared/login/login.component";
+import {SearchComponent} from './modules/repo/search/search.component';
import {BrowseComponent} from "./modules/repo/browse/browse.component";
import {UploadComponent} from "./modules/repo/upload/upload.component";
import {ManageRolesComponent} from "./modules/user/manage-roles/manage-roles.component";
-import {SecurityConfigurationComponent} from "./modules/user/security-configuration/security-configuration.component";
import {RoutingGuardService as Guard} from "./services/routing-guard.service";
-import {UserModule} from "./modules/user/user.module";
+import {SecurityConfigurationComponent} from "./modules/user/security-configuration/security-configuration.component";
/**
* You can use Guard (RoutingGuardService) for permission checking. The service needs data with one parameter 'perm',
*/
const routes: Routes = [
- { path: '', component: HomeComponent,
- children: [
- {path:'repo/search', component: SearchComponent},
- {path:'repo/browse', component: BrowseComponent},
- {path:'repo/upload', component: UploadComponent},
- {path:'', redirectTo:'repo/search', pathMatch:'full'},
- ]},
- { path: 'users', loadChildren: () => import('./modules/user/user.module').then(m => m.UserModule)
- },
- { path: 'user', component: HomeComponent,canActivate:[Guard],data:{perm: 'menu.user.section'},
- children: [
- { path: 'roles', component: ManageRolesComponent },
- { path: 'config', component: SecurityConfigurationComponent},
- ]
- },
- { path: 'contact', component: ContactComponent },
- { path: 'about', component: AboutComponent },
- { path: 'login', component: LoginComponent },
- { path: 'logout', component: HomeComponent },
- { path: '**', component: NotFoundComponent }
- ,
- {
- path: '',
- redirectTo: '',
- pathMatch: 'full'
- }
+ {
+ path: '', component: HomeComponent,
+ children: [
+ {path: 'repo/search', component: SearchComponent},
+ {path: 'repo/browse', component: BrowseComponent},
+ {path: 'repo/upload', component: UploadComponent},
+ {path: '', redirectTo: 'repo/search', pathMatch: 'full'},
+ ]
+ },
+
+ {
+ path: 'user', component: HomeComponent,canActivate:[Guard],data:{perm: 'menu.user.section'},
+ children: [
+ {path: 'users', loadChildren: () => import('./modules/user/user.module').then(m => m.UserModule)},
+ {path: 'roles', component: ManageRolesComponent},
+ {path: 'config', component: SecurityConfigurationComponent},
+ ]
+ },
+ {path: 'contact', component: ContactComponent},
+ {path: 'about', component: AboutComponent},
+ {path: 'login', component: LoginComponent},
+ {path: 'logout', component: HomeComponent},
+ {path: '**', component: NotFoundComponent}
+
];
@NgModule({
- imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }), UserModule],
- exports: [RouterModule],
- declarations: []
+ imports: [RouterModule.forRoot(routes)],
+ exports: [RouterModule],
+ declarations: []
})
-export class AppRoutingModule { }
+export class AppRoutingModule {
+}
*/
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
-import {HttpClientModule} from '@angular/common/http';
-import {MESSAGE_FORMAT_CONFIG} from 'ngx-translate-messageformat-compiler';
+import {HttpClient, HttpClientModule} from '@angular/common/http';
+import {MESSAGE_FORMAT_CONFIG, TranslateMessageFormatCompiler} from 'ngx-translate-messageformat-compiler';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {UploadComponent} from './modules/repo/upload/upload.component';
import {SecurityConfigurationComponent} from './modules/user/security-configuration/security-configuration.component';
import {CoreModule} from "./modules/core/core.module";
-import {SharedModule} from "./modules/shared/shared.module";
-import {UserModule} from "./modules/user/user.module";
+import {httpTranslateLoader, SharedModule} from "./modules/shared/shared.module";
+import {TranslateCompiler, TranslateLoader, TranslateModule} from "@ngx-translate/core";
@NgModule({
SecurityConfigurationComponent,
],
imports: [
+ TranslateModule.forRoot({
+ compiler: {
+ provide: TranslateCompiler,
+ useClass: TranslateMessageFormatCompiler
+ },
+ loader: {
+ provide: TranslateLoader,
+ useFactory: httpTranslateLoader,
+ deps: [HttpClient]
+ }
+ }),
BrowserModule,
AppRoutingModule,
FormsModule,
HttpClientModule,
CoreModule,
- SharedModule,
- UserModule
+ SharedModule
],
providers: [
{ provide: MESSAGE_FORMAT_CONFIG, useValue: { locales: ['en', 'de'] }}