aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/modal/video-support.component.ts
blob: 2d400e0be342bfb02c644ec376677f8b77ae90a2 (plain) (tree)
1
2
3
4
5


                                                           
                                                                        
                                                     








                                                 
                                     


                       



                                             



            
                                                                                           
                                      

   
import { Component, Input, ViewChild } from '@angular/core'
import { MarkdownService } from '@app/videos/shared'

import { VideoDetails } from '../../../shared/video/video-details.model'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'

@Component({
  selector: 'my-video-support',
  templateUrl: './video-support.component.html',
  styleUrls: [ './video-support.component.scss' ]
})
export class VideoSupportComponent {
  @Input() video: VideoDetails = null

  @ViewChild('modal') modal: NgbModal

  videoHTMLSupport = ''

  constructor (
    private markdownService: MarkdownService,
    private modalService: NgbModal
  ) {
    // empty
  }

  show () {
    this.videoHTMLSupport = this.markdownService.enhancedMarkdownToHTML(this.video.support)
    this.modalService.open(this.modal)
  }
}