Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

359
Views
¿Cómo deshabilitar el pegado de imágenes en ngx-editor?

Estaba tratando de usar ngx-editor para el editor de texto enriquecido, pero quiero deshabilitar la propiedad de pegar imágenes en el editor. Aunque eliminé el botón Insertar imagen de la barra de herramientas, todavía se están pegando las imágenes en el editor.

Enlace al documento del editor ngx: https://sibiraj-s.github.io/ngx-editor/#/

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

@HostListener('paste', ['$event']) private pasteFromClipboard(event: KeyboardEvent): void { event.preventDefault(); if (this.insertClipboardImage(event)) { return; } } private insertClipboardImage(event): File | null{ const pastedImage = getPastedImage(event); if (!pastedImage) return null; return pastedImage; } private getPastedImage(event): File | null { if (event.clipboardData) { if (event.clipboardData.files && event.clipboardData.files.length && isImageFile(event.clipboardData.files[0])) { return event.clipboardData.files[0]; } } return null; } private isImageFile(file: File): boolean { return file.type.search(/^image\//i) === 0; }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!