-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to Angular standalone components
- Loading branch information
Showing
10 changed files
with
88 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 17 additions & 21 deletions
38
...tes-client-angular/examples/app.module.ts → ...ubernetes-client-angular/examples/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
import { NgModule } from '@angular/core' | ||
import { BrowserModule } from '@angular/platform-browser' | ||
|
||
import { bootstrapApplication, BrowserModule } from '@angular/platform-browser' | ||
import { AppComponent } from './app.component' | ||
import { importProvidersFrom } from '@angular/core' | ||
import { StoreModule } from '@ngrx/store' | ||
import { EffectsModule } from '@ngrx/effects' | ||
import { DefaultDataServiceFactory, EntityDataModule } from '@ngrx/data' | ||
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http' | ||
import { | ||
DefaultEntityMetadataMap, | ||
KubernetesAuthorizerInterceptor, | ||
KubernetesDataServiceFactory, | ||
KubernetesDataServiceFactoryConfig, | ||
} from '@ccremer/kubernetes-client-angular' | ||
import { StoreModule } from '@ngrx/store' | ||
import { EffectsModule } from '@ngrx/effects' | ||
import { AppComponent } from './app.component' | ||
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||
|
||
@NgModule({ | ||
declarations: [AppComponent], | ||
imports: [ | ||
BrowserModule, | ||
HttpClientModule, | ||
StoreModule.forRoot(), | ||
EffectsModule.forRoot(), | ||
EntityDataModule.forRoot({ | ||
entityMetadata: DefaultEntityMetadataMap, | ||
}), | ||
], | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
importProvidersFrom( | ||
BrowserModule, | ||
StoreModule.forRoot(), | ||
EffectsModule.forRoot(), | ||
EntityDataModule.forRoot({ | ||
entityMetadata: DefaultEntityMetadataMap, | ||
}) | ||
), | ||
provideHttpClient(withInterceptorsFromDi()), | ||
{ provide: DefaultDataServiceFactory, useClass: KubernetesDataServiceFactory }, | ||
{ provide: HTTP_INTERCEPTORS, useClass: KubernetesAuthorizerInterceptor, multi: true }, | ||
{ | ||
provide: KubernetesDataServiceFactoryConfig, | ||
useValue: { | ||
default: { | ||
usePatchInUpsert: true, | ||
usePatchInUpdate: false, | ||
}, | ||
} satisfies KubernetesDataServiceFactoryConfig, | ||
}, | ||
], | ||
}) | ||
export class AppModule {} | ||
}).catch((err) => console.error(err)) |
4 changes: 3 additions & 1 deletion
4
...rnetes-client-angular/projects/kubernetes-client-example-angular/src/app/app.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
...ubernetes-client-angular/projects/kubernetes-client-example-angular/src/app/app.module.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...s-client-angular/projects/kubernetes-client-example-angular/src/app/login/login.module.ts
This file was deleted.
Oops, something went wrong.
46 changes: 40 additions & 6 deletions
46
packages/kubernetes-client-angular/projects/kubernetes-client-example-angular/src/main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,41 @@ | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' | ||
import { importProvidersFrom } from '@angular/core' | ||
import { AppComponent } from './app/app.component' | ||
import { StoreDevtoolsModule } from '@ngrx/store-devtools' | ||
import { EffectsModule } from '@ngrx/effects' | ||
import { StoreModule } from '@ngrx/store' | ||
import { AppRoutingModule } from './app/app-routing.module' | ||
import { bootstrapApplication, BrowserModule } from '@angular/platform-browser' | ||
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||
import { | ||
DefaultEntityMetadataMap, | ||
KubernetesAuthorizerInterceptor, | ||
KubernetesDataServiceFactory, | ||
KubernetesDataServiceFactoryConfig, | ||
} from 'kubernetes-client-angular' | ||
import { DefaultDataServiceFactory, EntityDataModule } from '@ngrx/data' | ||
|
||
import { AppModule } from './app/app.module' | ||
|
||
platformBrowserDynamic() | ||
.bootstrapModule(AppModule) | ||
.catch((err) => console.error(err)) | ||
bootstrapApplication(AppComponent, { | ||
providers: [ | ||
importProvidersFrom( | ||
BrowserModule, | ||
AppRoutingModule, | ||
StoreModule.forRoot(), | ||
EffectsModule.forRoot(), | ||
EntityDataModule.forRoot({ | ||
entityMetadata: DefaultEntityMetadataMap, | ||
}), | ||
StoreDevtoolsModule.instrument() | ||
), | ||
provideHttpClient(withInterceptorsFromDi()), | ||
{ provide: DefaultDataServiceFactory, useClass: KubernetesDataServiceFactory }, | ||
{ provide: HTTP_INTERCEPTORS, useClass: KubernetesAuthorizerInterceptor, multi: true }, | ||
{ | ||
provide: KubernetesDataServiceFactoryConfig, | ||
useValue: { | ||
default: { | ||
usePatchInUpsert: true, | ||
}, | ||
} satisfies KubernetesDataServiceFactoryConfig, | ||
}, | ||
], | ||
}).catch((err) => console.error(err)) |