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'
import { Video } from '../../../shared/video/video.model'
import { VideoComment } from './video-comment.model'
import { VideoCommentService } from './video-comment.service'
-import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { VideoCommentValidatorsService } from '@app/shared/forms/form-validators/video-comment-validators.service'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
constructor (
protected formValidatorService: FormValidatorService,
private videoCommentValidatorsService: VideoCommentValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private videoCommentService: VideoCommentService,
private authService: AuthService,
private modalService: NgbModal,
- private router: Router,
- private i18n: I18n
+ private router: Router
) {
super()
}
}
onValidKey () {
- this.onValueChanged()
+ this.check()
if (!this.form.valid) return
this.formValidated()
err => {
this.addingComment = false
- this.notificationsService.error(this.i18n('Error'), err.text)
+ this.notifier.error(err.text)
}
)
}
return this.form.value['text']
}
- getUrl () {
+ getUri () {
return window.location.href
}