Coder Social home page Coder Social logo

Comments (7)

JessePreiner avatar JessePreiner commented on June 3, 2024 1

@JoelParke You can pass a image handler when you initialize your data, for example

<editor [init]="getInitData()"></editor>

..and then in your .ts:

private getInitData() { return { image_upload_handler: <the function> } }

from tinymce-angular.

fyrkant avatar fyrkant commented on June 3, 2024

You should be able to set it in the [init] settings object, just like you'd do with the vanilla TinyMCE.

from tinymce-angular.

JoelParke avatar JoelParke commented on June 3, 2024

You can't quite do that, if you want to place the called function in the component. I ended up simply modifying the code and adding:

     @Input() images_upload_handler: any;
     @Input() file_picker_callback: any;

within the EditorComponent and then had those inputs used in the initialize() function:

      images_upload_handler: this.images_upload_handler,
      file_picker_callback: this.file_picker_callback,

from tinymce-angular.

fyrkant avatar fyrkant commented on June 3, 2024

I'm not sure I understand what you mean with "You can't quite do that, if you want to place the called function in the component", can you show an example?

from tinymce-angular.

fyrkant avatar fyrkant commented on June 3, 2024

Closing this as I don't think this a bug.

from tinymce-angular.

ItsRobbAllen avatar ItsRobbAllen commented on June 3, 2024

I see this was just closed, but does anyone have a full code example of this working? I need to be able to handle uploads very specifically and I've yet to get a single example working in Angular 6.

from tinymce-angular.

VV0nd3rer avatar VV0nd3rer commented on June 3, 2024

I see this was just closed, but does anyone have a full code example of this working? I need to be able to handle uploads very specifically and I've yet to get a single example working in Angular 6.

It works :) Just a small correction in getInitData() method, it should return images_upload_handler
So the result is somthing like this:

getInitData() {
    return {
      images_upload_handler: function (blobInfo, success, failure) {
        // Your implementation 
    }
  }

An example of image upload handler implementation is here.

from tinymce-angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.