Skip to content

Commit

Permalink
use lib spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
TehWazzard committed Jan 17, 2025
1 parent 87e00ec commit 5ee32b4
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 79 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@popperjs/core": "^2.11.8",
"@sentry/browser": "^5.20.1",
"@worldskills/bootstrap": "^4.10.1",
"@worldskills/worldskills-angular-lib": "^14.0.1",
"@worldskills/worldskills-angular-lib": "^14.0.2",
"angular-oauth2-oidc": "^19.0.0",
"jquery": "^3.5.1",
"json2typescript": "^1.4.1",
Expand Down
44 changes: 29 additions & 15 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {AlertsComponent, WorldskillsAngularLibModule, WsHttpInterceptor} from '@worldskills/worldskills-angular-lib';
import {WorldskillsAngularLibModule, WsHttpInterceptor} from '@worldskills/worldskills-angular-lib';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
Expand All @@ -10,12 +10,11 @@ import {OAuthModule} from 'angular-oauth2-oidc';
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import { HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';
import { HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import {NgSelectModule} from '@ng-select/ng-select';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import {CommonModule, DatePipe} from '@angular/common';
import {HttpInterceptorService} from '../services/http-interceptor/http-interceptor.service';
import {WsSpinnerComponent} from './ws-spinner/ws-spinner.component';
import {EventsComponent} from './events/events.component';
import {EventsSearchFormComponent} from './events-search-form/events-search-form.component';
import {EventComponent} from './event/event.component';
Expand Down Expand Up @@ -66,6 +65,15 @@ export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}

export const appTranslationConfig = TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
},
isolate: true // isolate property is the key point to remember/
});

@NgModule({
imports: [
CommonModule,
Expand All @@ -74,26 +82,30 @@ export function HttpLoaderFactory(http: HttpClient) {
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
WorldskillsAngularLibModule,
OAuthModule.forRoot(),
NgSelectModule,
NgbModule,
NgSelectModule,
FontAwesomeModule,
TranslateModule.forRoot({
defaultLanguage: 'en',
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
appTranslationConfig,
CKEditorModule,
WorldskillsAngularLibModule,
],
/*
FormsModule,
OAuthModule.forRoot(),
RouterModule.forRoot(appRoutes, routerOptions),
WorldskillsAngularLibModule,
NgbModule,
NgSelectModule,
appTranslationConfig], providers: [
{ provide: HTTP_INTERCEPTORS, useClass: WsHttpInterceptor, multi: true },
DatePipe,
provideHttpClient(withInterceptorsFromDi())
*/
declarations: [
AppComponent,
HomeComponent,
ErrorComponent,
WsSpinnerComponent,
EventsComponent,
EventsSearchFormComponent,
EventComponent,
Expand Down Expand Up @@ -142,7 +154,9 @@ export function HttpLoaderFactory(http: HttpClient) {
providers: [
DatePipe,
{provide: HTTP_INTERCEPTORS, useClass: WsHttpInterceptor, multi: true},
{provide: HTTP_INTERCEPTORS, useClass: HttpInterceptorService, multi: true}
{provide: HTTP_INTERCEPTORS, useClass: HttpInterceptorService, multi: true},
provideHttpClient(withInterceptorsFromDi())

],
bootstrap: [AppComponent]
})
Expand Down
Empty file.
5 changes: 0 additions & 5 deletions src/app/ws-spinner/ws-spinner.component.html

This file was deleted.

31 changes: 0 additions & 31 deletions src/app/ws-spinner/ws-spinner.component.spec.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/app/ws-spinner/ws-spinner.component.ts

This file was deleted.

0 comments on commit 5ee32b4

Please sign in to comment.