-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(store): add standalone features (#1999)
- Loading branch information
Showing
62 changed files
with
952 additions
and
429 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ApplicationConfig } from '@angular/platform-browser'; | ||
import { provideAnimations } from '@angular/platform-browser/animations'; | ||
|
||
import { appConfig } from './app.config'; | ||
|
||
// TODO: use `mergeApplicationConfig` in v16. | ||
export const appBrowserConfig: ApplicationConfig = { | ||
providers: [provideAnimations(), ...appConfig.providers] | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ApplicationConfig } from '@angular/platform-browser'; | ||
import { provideNoopAnimations } from '@angular/platform-browser/animations'; | ||
|
||
import { appConfig } from './app.config'; | ||
|
||
// TODO: use `mergeApplicationConfig` in v16. | ||
export const appServerConfig: ApplicationConfig = { | ||
providers: [provideNoopAnimations(), ...appConfig.providers] | ||
}; |
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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { APP_ID } from '@angular/core'; | ||
import { provideRouter } from '@angular/router'; | ||
import { ApplicationConfig } from '@angular/platform-browser'; | ||
import { provideStore } from '@ngxs/store'; | ||
import { withNgxsFormPlugin } from '@ngxs/form-plugin'; | ||
import { withNgxsLoggerPlugin } from '@ngxs/logger-plugin'; | ||
import { withNgxsReduxDevtoolsPlugin } from '@ngxs/devtools-plugin'; | ||
import { withNgxsRouterPlugin } from '@ngxs/router-plugin'; | ||
import { withNgxsStoragePlugin } from '@ngxs/storage-plugin'; | ||
|
||
import { TodosState } from '@integration/store/todos/todos.state'; | ||
import { TodoState } from '@integration/store/todos/todo/todo.state'; | ||
import { TODOS_STORAGE_KEY } from '@integration/store/todos/todos.model'; | ||
|
||
import { environment } from '../environments/environment'; | ||
|
||
export const APP_ID_VALUE = 'integration-app'; | ||
|
||
export const appConfig: ApplicationConfig = { | ||
providers: [ | ||
{ provide: APP_ID, useValue: APP_ID_VALUE }, | ||
|
||
provideRouter([ | ||
{ path: '', pathMatch: 'full', redirectTo: '/list' }, | ||
{ | ||
path: 'list', | ||
loadChildren: () => import('@integration/list/list.module').then(m => m.ListModule) | ||
}, | ||
{ | ||
path: 'detail', | ||
loadChildren: () => | ||
import('@integration/detail/detail.module').then(m => m.DetailModule) | ||
}, | ||
{ | ||
path: 'counter', | ||
loadChildren: () => | ||
import('@integration/counter/counter.module').then(m => m.CounterModule) | ||
} | ||
]), | ||
|
||
provideStore( | ||
[TodosState, TodoState], | ||
{ developmentMode: !environment.production, selectorOptions: {} }, | ||
withNgxsFormPlugin(), | ||
withNgxsLoggerPlugin({ logger: console, collapsed: false, disabled: true }), | ||
withNgxsReduxDevtoolsPlugin({ disabled: environment.production }), | ||
withNgxsRouterPlugin(), | ||
withNgxsStoragePlugin({ key: [TODOS_STORAGE_KEY] }) | ||
) | ||
] | ||
}; |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
import { enableProdMode } from '@angular/core'; | ||
|
||
import { environment } from './environments/environment'; | ||
|
||
if (environment.production) { | ||
enableProdMode(); | ||
} | ||
|
||
export { AppServerModule } from './app/app.server.module'; | ||
export { renderModuleFactory } from '@angular/platform-server'; | ||
export { AppComponent } from './app/app.component'; | ||
export { appServerConfig } from './app/app-server.config'; | ||
export { APP_ID_VALUE } from './app/app.config'; |
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,11 +1,12 @@ | ||
import { enableProdMode } from '@angular/core'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
import { bootstrapApplication } from '@angular/platform-browser'; | ||
|
||
import { AppModule } from './app/app.module'; | ||
import { AppComponent } from './app/app.component'; | ||
import { appBrowserConfig } from './app/app-browser.config'; | ||
import { environment } from './environments/environment'; | ||
|
||
if (environment.production) { | ||
enableProdMode(); | ||
} | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule); | ||
bootstrapApplication(AppComponent, appBrowserConfig); |
Oops, something went wrong.