@angular/common#HashLocationStrategy TypeScript Examples

The following examples show how to use @angular/common#HashLocationStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: app.module.ts    From 1x.ag with MIT License 6 votes vote down vote up
@NgModule({
    declarations: [
        AppComponent,
        BaseComponent,
        NoContentComponent,
        HowItWorksComponent
    ],
    imports: [
        BrowserAnimationsModule,
        AppRoutingModule,
        FormsModule,
        NgbModule,
        HttpClientModule,
        LoadingSpinnerModule,
        ModalModule.forRoot(),
        DeviceDetectorModule.forRoot(),
        NgbToastModule,
        ServiceWorkerModule.register('ngsw-worker.js', {
            enabled: navigator.userAgent.toLowerCase().indexOf('android') === -1 &&
                'serviceWorker' in navigator && environment.production
        }),
        FontAwesomeModule,
        AngularPageVisibilityModule
    ],
    providers: [
        {provide: LocationStrategy, useClass: HashLocationStrategy}
    ],
    bootstrap: [AppComponent]
})
export class AppModule {
}
Example #2
Source File: app.module.ts    From angular-electron-admin with Apache License 2.0 6 votes vote down vote up
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    CommonModule,
    HttpClientModule,
    BrowserAnimationsModule,
    AppRoutingModule
  ],
  providers: [
    {
      provide: LocationStrategy,
      useClass: HashLocationStrategy
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}
Example #3
Source File: app.module.ts    From dbm with Apache License 2.0 6 votes vote down vote up
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    CommonModule,
    HttpClientModule,
    BrowserAnimationsModule,
    AppRoutingModule
  ],
  providers: [
    {
      provide: LocationStrategy,
      useClass: HashLocationStrategy
    },
    {provide: NZ_CONFIG, useValue: ngZorroConfig}
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}
Example #4
Source File: platform-initializer.service.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 6 votes vote down vote up
private getQueryParams(locationStrategy: LocationStrategy): Map<string, string> {
    const urlSearchParams: URLSearchParams = (() => {
      if (locationStrategy instanceof HashLocationStrategy) {
        return new URLSearchParams(window.location.hash.substring(window.location.hash.indexOf('?')));
      }
      else {
        return new URLSearchParams(window.location.search);
      }
    })();

    const queryParams = new Map<string, string>();
    urlSearchParams.forEach((value, key) => queryParams.set(key, value));
    return queryParams;
  }
Example #5
Source File: app.module.ts    From sba-angular with MIT License 5 votes vote down vote up
@NgModule({
    imports: [
        BrowserModule,
        RouterModule.forRoot([]),
        FormsModule,
        ReactiveFormsModule,

        WebServicesModule.forRoot(startConfig),
        IntlModule.forRoot(DefaultLocalesConfig),
        LoginModule.forRoot(), // Just use default login modal
        ModalModule.forRoot(),
    ],
    declarations: [
        AppComponent,
    ],
    providers: [
        // Provides an APP_INITIALIZER which will fetch application configuration information from the Sinequa
        // server automatically at startup using the application name specified in the URL (app[-debug]/<app-name>).
        // This allows an application to avoid hard-coding parameters in the StartConfig but requires that the application
        // be served from the an app[-debug]/<app name> URL.
        // {provide: APP_INITIALIZER, useFactory: StartConfigInitializer, deps: [StartConfigWebService], multi: true},

        // Provides the Angular LocationStrategy to be used for reading route state from the browser's URL. Currently
        // only the HashLocationStrategy is supported by Sinequa.
        {provide: LocationStrategy, useClass: HashLocationStrategy},

        // Provides an HttpInterceptor to handle user login. The LoginInterceptor handles HTTP 401 responses
        // to Sinequa web service requests and initiates the login process.
        {provide: HTTP_INTERCEPTORS, useClass: LoginInterceptor, multi: true},

        // Provides an HttpInterceptor that offers a centralized location through which all client-side
        // audit records pass. An application can replace AuditInterceptor with a subclass that overrides
        // the updateAuditRecord method to add custom audit information to the records.
        {provide: HTTP_INTERCEPTORS, useClass: AuditInterceptor, multi: true},

        // Provides an HttpInterceptor that automatically processes any notifications specified in the $notifications
        // member of the response body to any Sinequa web service requests.
        {provide: HTTP_INTERCEPTORS, useClass: NotificationsInterceptor, multi: true},
    ],
    bootstrap: [
        AppComponent
    ]
})
export class AppModule {
}
Example #6
Source File: app.module.ts    From sba-angular with MIT License 5 votes vote down vote up
@NgModule({
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        RouterModule.forRoot(routes),
        FormsModule,
        ReactiveFormsModule,

        WebServicesModule.forRoot(startConfig),
        IntlModule.forRoot(AppLocalesConfig),
        LoginModule,
        ModalModule,

        BsSearchModule.forRoot(searchOptions),
        BsAutocompleteModule,
        BsNotificationModule,
        BsFacetModule,
        BsActionModule,
        BsModalModule,
        BsBasketsModule,
        BsAlertsModule,
        BsSavedQueriesModule,
        UtilsModule,
        BsLabelsModule,
        BsUserSettingsModule,
        ResultModule,
        BsFeedbackModule,
        BsPreviewModule,
        MetadataModule,
        BsSelectionModule,
        BsAdvancedModule
    ],
    declarations: [
        AppComponent,
        HomeComponent,
        SearchComponent,
        PreviewComponent,
        SearchFormComponent,
        AutocompleteExtended
    ],
    providers: [
        // Provides an APP_INITIALIZER which will fetch application configuration information from the Sinequa
        // server automatically at startup using the application name specified in the URL (app[-debug]/<app-name>).
        // This allows an application to avoid hard-coding parameters in the StartConfig but requires that the application
        // be served from the an app[-debug]/<app name> URL.
        // {provide: APP_INITIALIZER, useFactory: StartConfigInitializer, deps: [StartConfigWebService], multi: true},

        // Provides the Angular LocationStrategy to be used for reading route state from the browser's URL. Currently
        // only the HashLocationStrategy is supported by Sinequa.
        {provide: LocationStrategy, useClass: HashLocationStrategy},

        // Provides an HttpInterceptor to handle user login. The LoginInterceptor handles HTTP 401 responses
        // to Sinequa web service requests and initiates the login process.
        {provide: HTTP_INTERCEPTORS, useClass: LoginInterceptor, multi: true},

        // Provides an HttpInterceptor that offers a centralized location through which all client-side
        // audit records pass. An application can replace AuditInterceptor with a subclass that overrides
        // the updateAuditRecord method to add custom audit information to the records.
        {provide: HTTP_INTERCEPTORS, useClass: AuditInterceptor, multi: true},

        // Provides an HttpInterceptor that automatically processes any notifications specified in the $notifications
        // member of the response body to any Sinequa web service requests.
        {provide: HTTP_INTERCEPTORS, useClass: NotificationsInterceptor, multi: true},

        {provide: SCREEN_SIZE_RULES, useValue: breakpoints}
    ],
    bootstrap: [
        AppComponent
    ]
})
export class AppModule {
}
Example #7
Source File: admin.module.ts    From spurtcommerce with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@NgModule({
  declarations: [
    AdminComponent,
    PagerComponent,
    EditprofileComponent,
    ImagemanagerpopupComponent,
    CONTAINERS.AuthLayoutComponent,
    CONTAINERS.CommonLayoutComponent
  ],
  imports: [
    BrowserModule.withServerTransition({ appId: 'spurtcommerce' }),
    DefaultRoutingModule,
    PerfectScrollbarModule,
    BrowserAnimationsModule,
    FormsModule,
    ContainersModule,
    ComponentsModule,
    DefaultCommonModule,
    MaterialModule,
    CommonModule,
    ReactiveFormsModule,
    HttpClientModule,
    ToastrModule.forRoot(),
    ServiceWorkerModule.register('ngsw-worker.js', {
      enabled: environment.production
    }),
    StoreModule.forRoot(reducers, { metaReducers }),
    EffectsModule.forRoot([
      EditprofileEffect,
      OrderstatusEffects,
      StockEffects
    ]),
    CKEditorModule,
    NgbModule,
    NumberAcceptModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    })
  ],
  providers: [
    {
      provide: PERFECT_SCROLLBAR_CONFIG,
      useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG
    },
    {
      provide: LocationStrategy,
      useClass: HashLocationStrategy
    },
    ConfigService,
    {
      provide: HTTP_INTERCEPTORS,
      useClass: RequestInterceptor,
      multi: true
    },
    HTTPStatus,
    AppApiClient,
    AuthGuard,
    AuthService,
    AuthSandbox,
    StockService,
    StockSandbox,
    EditprofileSandbox,
    EditprofileService,
    OrderstatusSandbox,
    OrderstatusApiClientService
  ],

  bootstrap: [AdminComponent],
  entryComponents: [ImagemanagerpopupComponent]
})
export class AdminModule {}
Example #8
Source File: app.module.ts    From sba-angular with MIT License 4 votes vote down vote up
@NgModule({
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        RouterModule.forRoot(routes),
        FormsModule,
        ReactiveFormsModule,

        WebServicesModule.forRoot(startConfig),
        IntlModule.forRoot(AppLocalesConfig),
        LoginModule,
        ModalModule,

        BsSearchModule.forRoot(searchOptions),
        BsAutocompleteModule,
        BsNotificationModule,
        BsFacetModule,
        BsActionModule,
        BsModalModule,
        BsBasketsModule,
        BsAlertsModule,
        BsSavedQueriesModule,
        UtilsModule,
        BsLabelsModule,
        BsUserSettingsModule,
        ResultModule,
        BsFeedbackModule,
        BsPreviewModule,
        MetadataModule,
        BsSelectionModule,
        BsAdvancedModule,

        BsHeatmapModule,
        BsTimelineModule,
        NgxChartsModule,
        FusionChartsModule,
        VisTimelineModule,
        NetworkModule,
        GoogleMapsModule,
        AgmCoreModule.forRoot({
            apiKey: "" // Replace with your own Google Maps API key
        }),
        FinanceModule,
        GridsterModule
    ],
    declarations: [
        AppComponent,
        SearchComponent,
        SearchFormComponent,
        AutocompleteExtended,
        DashboardItemComponent,
        DashboardAddItemComponent
    ],
    providers: [
        // Provides an APP_INITIALIZER which will fetch application configuration information from the Sinequa
        // server automatically at startup using the application name specified in the URL (app[-debug]/<app-name>).
        // This allows an application to avoid hard-coding parameters in the StartConfig but requires that the application
        // be served from the an app[-debug]/<app name> URL.
        // {provide: APP_INITIALIZER, useFactory: StartConfigInitializer, deps: [StartConfigWebService], multi: true},

        // Provides the Angular LocationStrategy to be used for reading route state from the browser's URL. Currently
        // only the HashLocationStrategy is supported by Sinequa.
        {provide: LocationStrategy, useClass: HashLocationStrategy},

        // Provides an HttpInterceptor to handle user login. The LoginInterceptor handles HTTP 401 responses
        // to Sinequa web service requests and initiates the login process.
        {provide: HTTP_INTERCEPTORS, useClass: LoginInterceptor, multi: true},

        // Provides an HttpInterceptor that offers a centralized location through which all client-side
        // audit records pass. An application can replace AuditInterceptor with a subclass that overrides
        // the updateAuditRecord method to add custom audit information to the records.
        {provide: HTTP_INTERCEPTORS, useClass: AuditInterceptor, multi: true},

        // Provides an HttpInterceptor that automatically processes any notifications specified in the $notifications
        // member of the response body to any Sinequa web service requests.
        {provide: HTTP_INTERCEPTORS, useClass: NotificationsInterceptor, multi: true},

        {provide: SCREEN_SIZE_RULES, useValue: breakpoints},
        {provide: SELECTION_OPTIONS, useValue: selectionOptions}
    ],
    bootstrap: [
        AppComponent
    ]
})
export class AppModule {
}