How to use ngx-cookie - 10 common examples

To help you get started, we’ve selected a few ngx-cookie 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 RackHD / on-web-ui / src / app / app.module.ts View on Github external
*/

@NgModule({
  bootstrap: [AppComponent],
  declarations: [
    AppComponent,
    HeaderComponent,
    GlobalAlertComponent
  ],
  /**
   * Import Angular's modules.
   */
  imports: [
    BrowserModule,
    ClarityModule.forRoot(),
    CookieModule.forRoot(),
    AppRoutingModule,
    BrowserAnimationsModule,
    FormsModule,
    HttpClientModule,
    SharedServicesModule,
    // Feature module
    NoContentModule,
    SettingModule,
    /**
     * This section will import the `DevModuleModule` only in certain build types.
     * When the module is not imported it will get tree shaked.
     * This is a simple example, a big app should probably implement some logic
     */
    ...environment.showDevModule ? [] : [],
  ],
  /**
github jhipster / jhipster-online / src / main / webapp / app / shared / shared-libs.module.ts View on Github external
import { CommonModule } from '@angular/common';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgJhipsterModule } from 'ng-jhipster';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { CookieModule } from 'ngx-cookie';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

@NgModule({
    imports: [
        NgbModule.forRoot(),
        NgJhipsterModule.forRoot({
            // set below to true to make alerts look like toast
            alertAsToast: false
        }),
        InfiniteScrollModule,
        CookieModule.forRoot(),
        FontAwesomeModule
    ],
    exports: [FormsModule, CommonModule, NgbModule, NgJhipsterModule, InfiniteScrollModule, FontAwesomeModule]
})
export class JhonlineSharedLibsModule {}
github Teradata / kylo / install / install-inspector / install-inspector-app / src / main / webapp / app / shared / shared-libs.module.ts View on Github external
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgJhipsterModule } from 'ng-jhipster';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { CookieModule } from 'ngx-cookie';

@NgModule({
    imports: [
        NgbModule.forRoot(),
        NgJhipsterModule.forRoot({
            // set below to true to make alerts look like toast
            alertAsToast: false,
            i18nEnabled: true,
            defaultI18nLang: 'en'
        }),
        InfiniteScrollModule,
        CookieModule.forRoot()
    ],
    exports: [
        FormsModule,
        CommonModule,
        NgbModule,
        NgJhipsterModule,
        InfiniteScrollModule
    ]
})
export class InspectorSharedLibsModule {}
github jhipster / jhipster-sample-app-micronaut / src / main / webapp / app / shared / shared-libs.module.ts View on Github external
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgJhipsterModule } from 'ng-jhipster';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
import { CookieModule } from 'ngx-cookie';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

@NgModule({
    imports: [NgbModule.forRoot(), InfiniteScrollModule, CookieModule.forRoot(), FontAwesomeModule],
    exports: [FormsModule, CommonModule, NgbModule, NgJhipsterModule, InfiniteScrollModule, FontAwesomeModule]
})
export class JhipsterSampleApplicationSharedLibsModule {
    static forRoot() {
        return {
            ngModule: JhipsterSampleApplicationSharedLibsModule
        };
    }
}
github ordercloud-api / ngx-shopper / src / UI / Seller / src / app / auth / containers / forgot-password / forgot-password.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ForgotPasswordComponent],
      imports: [ReactiveFormsModule, CookieModule.forRoot(), HttpClientModule],
      providers: [
        { provide: Router, useValue: router },
        { provide: OcPasswordResetService, useValue: ocPasswordService },
        { provide: ToastrService, useValue: toastrService },
        {
          provide: applicationConfiguration,
          useValue: new InjectionToken('app.config'),
        },
      ],
    }).compileComponents();
  }));
github ecsnavarretemit / sarai-interactive-maps / src / app / app.component.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        SaraiInteractiveMapsRoutingModule,
        ModalModule.forRoot(),
        TooltipModule.forRoot(),
        AccordionModule.forRoot(),
        CookieModule.forRoot(),
        StoreModule,
        MapModule,
        UiModule,
        TranslateModule.forRoot({
          loader: {
            provide: TranslateLoader,
            useFactory: TranslationFactoryLoader,
            deps: [Http]
          }
        }),
        Angulartics2Module.forRoot([
          Angulartics2GoogleAnalytics
        ])
      ],

      declarations: [
github ordercloud-api / ngx-shopper / src / UI / Seller / src / app / auth / interceptors / refresh-token / refresh-token.interceptor.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [CookieModule.forRoot(), HttpClientTestingModule],
      providers: [
        { provide: AppAuthService, useValue: appAuthService },
        { provide: OcTokenService, useValue: tokenService },
        {
          provide: HTTP_INTERCEPTORS,
          useClass: RefreshTokenInterceptor,
          multi: true,
        },
        {
          provide: applicationConfiguration,
          useValue: new InjectionToken('app.config'),
        },
      ],
    });
    httpClient = TestBed.get(HttpClient);
    httpMock = TestBed.get(HttpTestingController);
github robinv8 / ng-ant-admin / src / app / shared.module.ts View on Github external
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ReactiveFormsModule, FormsModule} from '@angular/forms';
import {HttpClientModule} from '@angular/common/http';
import {RouterModule} from '@angular/router';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {CookieModule} from 'ngx-cookie';
import {ChartsModule} from 'ng2-charts/ng2-charts';
import {StorageModule} from './core/storage/storage.module';

@NgModule({
  imports: [
    HttpClientModule,
    NgZorroAntdModule.forRoot(),
    CookieModule.forRoot(),
    StorageModule,
  ],
  exports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    NgZorroAntdModule,
    RouterModule,
    ChartsModule
  ]
})
export class SharedModule {
  static forRoot(): ModuleWithProviders {
    return {
      ngModule: SharedModule
    };
github goharbor / harbor / src / portal / src / lib / utils / shared / shared.module.ts View on Github external
**
 * class SharedModule
 */
@NgModule({
    imports: [
        CommonModule,
        HttpClientModule,
        HttpClientXsrfModule.withOptions({
            cookieName: '_xsrf',
            headerName: 'X-Xsrftoken'
        }),
        FormsModule,
        ReactiveFormsModule,
        ClipboardModule,
        ClarityModule,
        CookieModule.forRoot(),
        MarkdownModule.forRoot(),
        TranslateModule.forRoot({
            loader: {
                provide: TranslateLoader,
                useFactory: (GeneralTranslatorLoader),
                deps: [HttpClient, SERVICE_CONFIG]
            },
            missingTranslationHandler: {
                provide: MissingTranslationHandler,
                useClass: MyMissingTranslationHandler
            }
        }),
    ],
    exports: [
        CommonModule,
        HttpClientModule,
github chef / automate / components / automate-ui / src / app / pages / +compliance / +reporting / +reporting-profiles / reporting-profiles.component.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        CookieModule.forRoot(),
        HttpClientTestingModule
      ],
      declarations: [
        ReportingProfilesComponent
      ],
      providers: [
        { provide: TelemetryService, useClass: MockTelemetryService },
        { provide: ChefSessionService, useClass: MockChefSessionService },
        StatsService,
        ReportQueryService,
        ReportDataService
      ],
      schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
    });

    fixture = TestBed.createComponent(ReportingProfilesComponent);

ngx-cookie

Implementation of Angular 1.x $cookies service to Angular

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular ngx-cookie functions