Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const apiRoot = environment.apiUrlBase + '/';
const defaultDataServiceConfig: DefaultDataServiceConfig = {
root: apiRoot,
entityHttpResourceUrls: {
Customer: { entityResourceUrl: apiRoot + 'customers/', collectionResourceUrl: apiRoot + 'customers/' },
Order: { entityResourceUrl: apiRoot + 'orders/', collectionResourceUrl: apiRoot + 'orders/' },
}
};
@NgModule({
imports: [
StoreModule.forRoot({}),
EffectsModule.forRoot([]),
EntityDataModule.forRoot(),
environment.production ? [] : StoreDevtoolsModule.instrument()
],
providers: [ { provide: DefaultDataServiceConfig, useValue: defaultDataServiceConfig } ]
})
export class AppStoreModule {}
import { entityConfig } from './entity-metadata';
const apiRoot = environment.apiUrlBase + '/';
const defaultDataServiceConfig: DefaultDataServiceConfig = {
root: apiRoot,
entityHttpResourceUrls: {
Customer: { entityResourceUrl: apiRoot + 'customers/', collectionResourceUrl: apiRoot + 'customers/' },
Order: { entityResourceUrl: apiRoot + 'orders/', collectionResourceUrl: apiRoot + 'orders/' },
}
};
@NgModule({
imports: [
StoreModule.forRoot({}),
EffectsModule.forRoot([]),
EntityDataModule.forRoot(entityConfig),
environment.production ? [] : StoreDevtoolsModule.instrument()
],
providers: [ { provide: DefaultDataServiceConfig, useValue: defaultDataServiceConfig } ]
})
export class AppStoreModule {}
import { EffectsModule } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { environment } from '../../environments/environment';
import { entityConfig } from './entity-metadata';
import { EntityDataModule } from '@ngrx/data';
import { NgrxDataToastService } from './ngrx-data-toast.service';
import { VillainEffects } from './villains/villain-effects';
@NgModule({
imports: [
StoreModule.forRoot({}),
EffectsModule.forRoot([VillainEffects]),
environment.production ? [] : StoreDevtoolsModule.instrument(),
EntityDataModule.forRoot(entityConfig)
]
})
export class AppStoreModule {
constructor(toastService: NgrxDataToastService) {}
}