How to use the @angular/router-deprecated.RouteParams function in @angular/router-deprecated

To help you get started, we’ve selected a few @angular/router-deprecated 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 deeleman / learning-angular2 / chapter_10 / app / timer / timer-widget.component.spec.ts View on Github external
beforeEachProviders(() => [
    TestComponentBuilder,
    SettingsService,
    TaskService,

    // RouteParams is instantiated with custom values upon injecting
    provide(RouteParams, { useValue: new RouteParams({ id: null }) }),

    MockBackend,
    BaseRequestOptions,
    // We override the default Http provider implementation
    provide(Http, {
      useFactory: (backend: MockBackend, options: BaseRequestOptions) => {
        return new Http(backend, options);
      },
      deps: [MockBackend, BaseRequestOptions]
    }),
    TimerWidgetComponent
  ]);
github Alfresco / alfresco-ng2-components / ng2-components / ng2-alfresco-search / src / components / alfresco-search.component.spec.ts View on Github external
it('should take the provided search term from query param provided via RouteParams', () => {
        let search = new AlfrescoSearchComponent(null, null, null, new RouteParams({ q: 'exampleTerm692' }));
        expect(search.searchTerm).toBe('exampleTerm692');
    });