import { Component, OnInit, OnDestroy } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
+import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
import { NotificationsService } from 'angular2-notifications'
protected authService: AuthService,
protected notificationsService: NotificationsService,
protected confirmService: ConfirmService,
+ protected location: Location,
private videoService: VideoService) {
super()
}
import { ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
+import { Location } from '@angular/common'
import { isInMobileView } from '@app/shared/misc/utils'
import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive'
import { NotificationsService } from 'angular2-notifications'
protected abstract authService: AuthService
protected abstract router: Router
protected abstract route: ActivatedRoute
+ protected abstract location: Location
protected abstract currentRoute: string
abstract titlePage: string
}
protected setNewRouteParams () {
- const routeParams = this.buildRouteParams()
- this.router.navigate([ this.currentRoute ], { queryParams: routeParams })
+ const paramsObject = this.buildRouteParams()
+
+ const queryParams = Object.keys(paramsObject).map(p => p + '=' + paramsObject[p]).join('&')
+ this.location.replaceState(this.currentRoute, queryParams)
}
protected buildVideoPages () {
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { immutableAssign } from '@app/shared/misc/utils'
+import { Location } from '@angular/common'
import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
protected route: ActivatedRoute,
protected notificationsService: NotificationsService,
protected authService: AuthService,
+ protected location: Location,
private videoService: VideoService) {
super()
}
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
+import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
constructor (protected router: Router,
protected route: ActivatedRoute,
+ protected location: Location,
protected notificationsService: NotificationsService,
protected authService: AuthService,
private videoService: VideoService) {
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
+import { Location } from '@angular/common'
import { RedirectService } from '@app/core'
import { immutableAssign } from '@app/shared/misc/utils'
import { NotificationsService } from 'angular2-notifications'
protected route: ActivatedRoute,
protected notificationsService: NotificationsService,
protected authService: AuthService,
+ protected location: Location,
private videoService: VideoService,
private redirectService: RedirectService
) {
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
+import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
protected route: ActivatedRoute,
protected notificationsService: NotificationsService,
protected authService: AuthService,
+ protected location: Location,
private videoService: VideoService) {
super()
}