import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { Observable } from 'rxjs'
import { VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model'
import { FormReactive } from '../../../shared'
@Output() commentCreated = new EventEmitter<VideoCommentCreate>()
@ViewChild('visitorModal') visitorModal: NgbModal
- @ViewChild('textarea') private textareaElement: ElementRef
+ @ViewChild('textarea') textareaElement: ElementRef
- private addingComment = false
+ addingComment = false
constructor (
protected formValidatorService: FormValidatorService,
private videoCommentValidatorsService: VideoCommentValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private videoCommentService: VideoCommentService,
private authService: AuthService,
private modalService: NgbModal,
err => {
this.addingComment = false
- this.notificationsService.error(this.i18n('Error'), err.text)
+ this.notifier.error(err.text)
}
)
}
gotoLogin () {
this.hideVisitorModal()
- this.authService.redirectUrl = this.router.url
this.router.navigate([ '/login' ])
}