How to use the @ngxs/store.NgxsModule.forRoot function in @ngxs/store

To help you get started, we’ve selected a few @ngxs/store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ForetagInc / fullstack-ts-boilerplate / libs / core / src / lib / core.module.ts View on Github external
import { CustomStorage } from './services/custom-storage.service';
import { NgxsStoragePluginOptions } from '@ngxs/storage-plugin/src/symbols';

@NgModule({
  providers: [
    CoreService,
  ],
  exports: [
    ClarityModule,
    ClrFormsNextModule,
  ],
  imports: [
    CommonModule,
    HttpClientModule,
    // NgxPageScrollModule,
    NgxsModule.forRoot([]),
    NgxsFormPluginModule.forRoot(),
    NgxsRouterPluginModule.forRoot(),
    ClarityModule,
    ClrFormsNextModule,
    GraphqlModule,
    AuthModule,
    I18nModule,
    NgxsReduxDevtoolsPluginModule.forRoot({
      disabled: environment.production,
    }),
    NgxsStoragePluginModule.forRoot({
      key: 'auth.token',
    }),
  ]
})
export class CoreModule {
github T-Systems-MMS / phonebook / Phonebook.Frontend / src / app / shared / states / LastPersons.state.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [NgxsModule.forRoot([LastPersonsState])]
    }).compileComponents();
    store = TestBed.get(Store);
    store.reset({
      lastpersons: []
    });
  }));
  it('it adds LastPerson on Top', () => {
github ngxs / store / src / spec / module.spec.ts View on Github external
})
class FeatureState {}

interface FeatureStateModel2 {
  baz: string;
}
@State({
  name: 'feature2',
  defaults: {
    baz: '!'
  }
})
class FeatureState2 {}

@NgModule({
  imports: [NgxsModule.forRoot([RootState])]
})
class RootModule {}

@NgModule({
  imports: [NgxsModule.forFeature([FeatureState])]
})
class FeatureModule {}

@NgModule({
  imports: [NgxsModule.forFeature([FeatureState])]
})
class FeatureModule2 {}

describe('module', () => {
  it('should configure and run with no states', () => {
    TestBed.configureTestingModule({
github eranshmil / ngxs-example-app / src / app / auth / containers / login-page.component.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        NoopAnimationsModule,
        NgxsModule.forRoot(AuthStates),
        MatInputModule,
        MatCardModule,
        ReactiveFormsModule,
      ],
      declarations: [LoginPageComponent, LoginFormComponent],
      providers: [AuthService],
    });

    fixture = TestBed.createComponent(LoginPageComponent);
    instance = fixture.componentInstance;
    store = TestBed.get(Store);

    spyOn(store, 'dispatch').and.callThrough();
  });
github eranshmil / ngxs-example-app / src / app / books / containers / collection-page.component.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        CoreModule.forRoot(),
        HttpClientModule,
        NoopAnimationsModule,
        NgxsModule.forRoot(BooksStates),
        MatCardModule,
        MatInputModule,
        RouterTestingModule,
      ],
      declarations: [
        CollectionPageComponent,
        BookPreviewListComponent,
        BookPreviewComponent,
        BookAuthorsComponent,
        AddCommasPipe,
        EllipsisPipe,
      ],
    });

    fixture = TestBed.createComponent(CollectionPageComponent);
    instance = fixture.componentInstance;
github angular / ngcc-validation / projects / ngxsstore-ngcc / src / app / app.module.ts View on Github external
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { NgxsModule } from '@ngxs/store';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxsModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
github abpframework / abp / templates / app / angular / src / app / app.module.ts View on Github external
import { SettingManagementConfigModule } from '@abp/ng.setting-management.config';

const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })];

@NgModule({
  declarations: [AppComponent],
  imports: [
    CoreModule.forRoot({
      environment,
      requirements: {
        layouts: LAYOUTS,
      },
    }),
    ThemeSharedModule.forRoot(),
    OAuthModule.forRoot(),
    NgxsModule.forRoot([]),
    AccountConfigModule.forRoot({ redirectUrl: '/' }),
    IdentityConfigModule,
    TenantManagementConfigModule,
    SettingManagementConfigModule,
    BrowserModule,
    BrowserAnimationsModule,
    AppRoutingModule,
    SharedModule,

    ...(environment.production ? [] : LOGGERS),
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
github xlayers / xlayers / src / app / editor / code / editor-container / codegen / codegen.service.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [CodeGenService],
      imports: [
        NgxsModule.forRoot([UiState, CodeGenState]),
        MatSnackBarModule,
        HttpClientTestingModule
      ]
    });
  });
github xlayers / xlayers / src / app / editor / code / editor-container / editor-container.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      schemas: [NO_ERRORS_SCHEMA],
      imports: [
        NgxsModule.forRoot([XStore]),
        MatMenuModule,
        MatSnackBarModule
      ],
      providers: [
        {
          provide: CodeGenService,
          useValue: codeGenService
        }
      ],
      declarations: [EditorContainerComponent]
    }).compileComponents();

    store = TestBed.get(Store);
  }));
github mflorence99 / el-3270 / renderer / app / module.ts View on Github external
const SERVICES = [
  LU3270Service
];

@NgModule({

  bootstrap: [RootPageComponent],

  declarations: [
    ...COMPONENTS
  ],

  imports: [
    ...MODULES,
    NgxsModule.forRoot(states),
    NgxsLoggerPluginModule.forRoot({
      collapsed: false,
      logger: console
    }),
    NgxsStoragePluginModule.forRoot({
      key: ['prefs', 'layout', 'window'],
      storage: StorageOption.LocalStorage
    }),
    NgxsReduxDevtoolsPluginModule.forRoot({disabled: !window['DEV_MODE']}),
    RouterModule.forRoot(ROUTES, { enableTracing: false, useHash: true })
  ],

  providers: [
    ...SERVICES
  ]