Как загрузить изображение в s3 из встроенного редактора froala, используя Angular 5 - PullRequest
0 голосов
/ 19 июня 2020

Я использую пакет angular -froala-wysiwyg и пытаюсь загрузить изображение в s3, которое вставлено во встроенный редактор. Я сослался на документы, но без помощи для angular

Вот конфигурация s3

var configs = {
  bucket: 'bucket-name',
  region: 'eu-west-1',
  keyStart: 'uploads',
  acl: 'public-read',
  accessKey: '**',
  secretKey: '**'
}


const froalaConfigOptions: Object = {
      placeholderText: 'Add your content here',
      charCounterCount: true,
      key: environment.froalaOptions.key,
      toolbarButtons: ['fullscreen', 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', '|',
        'fontFamily', 'fontSize', 'color', 'inlineStyle', 'paragraphStyle', '|', 'paragraphFormat', 'align', 'formatOL',
        'formatUL', 'outdent', 'indent', '-', 'quote', 'insertLink', 'insertImage', 'embedly', 'insertTable', '|', 'emoticons',
        'specialCharacters', 'insertHR', 'selectAll', 'clearFormatting', '|', 'print', 'help', 'html', '|', 'undo', 'redo', 'my_dropdown'],
      quickInsertTags: [''],
      heightMin: 200,
      heightMax: 500,
      fullPage: true,
      useClasses: false,
      imageInsertButtons: ['imageBack', '|', 'imageUpload', '|', 'imageByURL'],
      events: {
        'froalaEditor.initialized': function () {
        },
        'froalaEditor.image.beforeUpload': function (e, editor, images) {
        },
        'froalaEditor.image.uploadedToS3': (e, editor, link, key, response) => {
        },
        'froalaEditor.image.error': function (e, editor, error, response) {
          if (error) {
            console.log(error);
          }
        }
      }
    };

В angular html привязка вот так

<div class="froala-wrapper" [froalaEditor]="froalaOptions" formControlName='htmlContent'> Hello, Froala!</div>

enter image description here

какими должны быть следующие шаги, чтобы что изображения загружаются?

...