adeelhussain / summernote-image-attribute-editor

Summernote Editor Plugin for Edit image alt, title, caption and resize
https://adeelhussain.github.io/summernote-image-attribute-editor/
9 stars 9 forks source link

Has issues integrating with ngx-summernote #2

Closed CZHerrington closed 3 years ago

CZHerrington commented 3 years ago

I'm currently trying to get summernote-image-attribute-editor to work with ngx-summernote, an Angular summernote package.

Have you ever used your plugin with Angular or similar frameworks? I'm not sure if it's possible to get it working without modifying the source library, or engaging in other hackiness on my part.

I would appreciate your advice!

adeelhussain commented 3 years ago

@CZHerrington , you need to include the plugin and language file in angular.json


"scripts": [
  ...
   "node_modules/summernote-image-attributes-editor/lang/en-us.js",
   "node_modules/summernote-image-attributes-editor/summernote-image-attributes.js"
]

after that pass the options in config, like mention in the demo code


imageAttributes: {
      icon: '<i class="note-icon-pencil"/>',
      figureClass: 'figureClass',
      figcaptionClass: 'captionClass',
      captionText: 'Caption Goes Here.',
      manageAspectRatio: true // true = Lock the Image Width/Height, Default to true
    },
    popover: {
      image: [
        ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
        ['float', ['floatLeft', 'floatRight', 'floatNone']],
        ['remove', ['removeMedia']],
        ['custom', ['imageAttributes']],
      ],
    },
CZHerrington commented 3 years ago

Thank you, adding the scripts to my angular.json file fixed the issue!