Coder Social home page Coder Social logo

unlayer / angular-email-editor Goto Github PK

View Code? Open in Web Editor NEW
193.0 193.0 163.0 1.65 MB

Drag-n-Drop Email Editor Component for Angular

Home Page: https://unlayer.com/embed

License: MIT License

JavaScript 10.92% TypeScript 78.31% CSS 5.79% HTML 4.98%
angular angular-components builder drag-and-drop email-marketing email-template html-emails template

angular-email-editor's People

Contributors

adeelraza avatar brunolemos avatar kaustubhkhare19 avatar lucasbesen avatar tboeckmann avatar umairsiddique avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-email-editor's Issues

Disable "insert/edit image" tool on text editor toolbar

Is it possible to disable the insert/edit image tool on the toolbar in Legacy Templates?

Screen Shot 2022-02-17 at 10 04 53 AM

I am able to disable the emojis passing the below in the options:

{ features: { textEditor: { emojis: false } } }

I wonder if it is possible to do the same for the image?

upload images

is it possible to save the images on my s3 or my upload folder of the angular project itself?

email-editor support under the NgbModal?

I tried to Put an email editor inside the NgbModal. But, it gives an editor undefined.

<button class="btn btn-primary" (click)="openDialog(openModal)">>Open Dialog</button>

<ng-template #openModal let-modal>
    <div class="modal-header bg-white">       
    </div>
    <div class="modal-body bg-white pl-0 pr-0 pt-0 pb-0">
           <email-editor #emailEditor (loaded)="editorLoaded()" (ready)="editorReady()"></email-editor>
    </div>
</ng-template>


openDialog() {
 this.modalService.open(targetModal, {
        size: 'md',
        backdrop: true
      });
}
  
public editorLoaded() {
}

public editorReady() {
     this.emailEditor?.editor?.loadDesign();
}

public exportHtml() {
      //Here it gives the error
     //core.mjs:6494 ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'editor')
     //TypeError: Cannot read properties of undefined (reading 'editor')

      this.emailEditor.editor.exportHtml((data) => {
      });

 }

Does anyone know if this works with NgbModal or not?

onChange or Autosave Methods

Hi, just want to ask if there is a possibility for onChange or auto save method when adding columns/text on the builder

ERROR Error: Could not find a valid element for given id or className.

I am trying to integrate this with my existing angular application. I am showing this editor into the popup. At the first time, it is working fine. But if I close the popup and try to open it again then it is giving the following error.

Error: Could not find a valid element for given id or className.

Angular -> 7
Angular Material -> 7
angular-email-editor -> 0.7.0

My observations,
At the first time component is able to add id to div. But when I reopen the popup again then id is not applied to div. Due to this, I am getting the above error.

Is there any solution to this issue?

When Template load

i have installed editor and when json template load
after that throw error
aaaa

Cannot pass customCSS and customJS to angular component

The angular-wrapper does not support these options to be passed to the component

	<email-editor [appearance]="editorAppearance" [customCSS]="'https://examples.unlayer.com/examples/custom-css/custom.css'" [options]="options" [projectId]="id" (loaded)="editorLoaded($event)" (ready)="editorReady($event)"></email-editor>

gives an error: Can't bind to 'customCSS' since it isn't a known property of 'email-editor'.

Error when trying to edit the text of a button

Hello, install the library of a layer, initialize the component and everything works perfectly, until I add a button and click on it to edit its text and I find that the canvas turns blank and the error is reflected in the console

TypeError: Cannot read property 'getItem' of null

That same error occurs when I add a text block and try to edit the text in the block.

Preview template on page load

Please how do I preview the template on page load?

When the page loads in I want to trigger the preview so it just previews the template without the editing tools.

I will be glad if anyone can help out, thanks

ERROR Error: Could not find a valid element for given id or className.

I am trying to integrate this with my existing angular application. I am showing this editor into the popup. At the first time, it is working fine. But if I close the popup and try to open it again then it is giving the following error.

Error: Could not find a valid element for given id or className.

Angular -> 7
Angular Material -> 7
angular-email-editor -> 0.7.0

My observations,
At the first time component is able to add id to div. But when I reopen the popup again then id is not applied to div. Due to this, I am getting the above error.

Is there any solution to this issue?

Request - Update to Angular 16

Currently if you try to use it with v16 project, you'll get this:
Error: EmailEditorModule does not have a module def (ɵmod property)
As far as I understand it is related to the drop of ngcc in the latest version

Custom tool not working

I am trying to add a custom tool without success.

I have passed as a parameter in tools:
<email-editor
[options]="config"
[tools]="tools"
(loaded)="editorLoaded()"
(ready)="editorReady()"
#template
></email-editor>

I have tried to load it in the init:

this.emailEditor.editor.init({
id: 'editor-1',
displayMode: 'email',
customJS: [url_to.js],
});
It would be very helpful if you added a basic example of how to create a custom tool in the examples directory

Not working with my html

Shall We need to provide the fixed format of json to work with these package ? As we have different different templates.

Can't disable the ability to exit view mode

I need to display content only without editing capabilities. But I was surprised to notice that this cannot be done. I can open preview with unlayer.showPreview("desktop"). But user can leave preview mode when click on overlay.

DefineInjectable was not found with angular 4 and 5

WARNING in ./node_modules/angular-email-editor/fesm5/angular-email-editor.js
14:41-57 "export 'defineInjectable' was not found in '@angular/core'
at HarmonyImportSpecifierDependency._getErrors (E:\logiciel-projects\EROOF\webapp\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:65:15)
at HarmonyImportSpecifierDependency.getWarnings (E:\logiciel-projects\EROOF\webapp\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:39:15)
at Compilation.reportDependencyErrorsAndWarnings (E:\logiciel-projects\EROOF\webapp\node_modules\webpack\lib\Compilation.js:703:24)
at Compilation.finish (E:\logiciel-projects\EROOF\webapp\node_modules\webpack\lib\Compilation.js:561:9)
at E:\logiciel-projects\EROOF\webapp\node_modules\webpack\lib\Compiler.js:506:17
at E:\logiciel-projects\EROOF\webapp\node_modules\tapable\lib\Tapable.js:289:11
at E:\logiciel-projects\EROOF\webapp\node_modules\webpack\lib\Compilation.js:507:11
at E:\logiciel-projects\EROOF\webapp\node_modules\webpack\lib\Compilation.js:477:14
at processTicksAndRejections (internal/process/task_queues.js:79:11)
@ ./node_modules/angular-email-editor/fesm5/angular-email-editor.js
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

[Request] Use with Angular 11

Hello, is there a way to use it with Angular 11?
If not, is a release planned for that version?

I need this lib as I need to drink water at the moment

How do I use init()/registerTool() etc. in angular?

For example - how would I implement the following in Angular?

unlayer.registerTool({
name: 'my_tool',
label: 'My Tool',
icon: 'fa-smile',
supportedDisplayModes: ['web', 'email'],
options: {},
values: {},
renderer: {
Viewer: unlayer.createViewer({
render(values) {
return "

I am a custom tool.
"
}
}),
exporters: {
web: function(values) {
return "
I am a custom tool.
"
},
email: function(values) {
return "
I am a custom tool.
"
}
},
head: {
css: function(values) {},
js: function(values) {}
}
}
});

or this..:

unlayer.init({
className: 'unlayer-editor',
displayMode: 'email'
customCSS: ['https://examples.unlayer.com/examples/custom-css/custom.css'],
})

I have tried:
this.emailEditor.editor.init({
className: 'unlayer-editor',
displayMode: 'email'
customCSS: ['https://examples.unlayer.com/examples/custom-css/custom.css'],
})

But this does not work / only duplicates the editor instance

exportHtml not working

core.js:6456 ERROR TypeError: Cannot read property 'exportHtml' of undefined
at EmailEditorComponent.exportHtml (angular-email-editor.js:110)

exportHtml() {
this.emailEditor.editor.exportHtml((data) => console.log('exportHtml', data));
}

"@angular/animations": "~12.0.2",
"@angular/cdk": "^12.0.2",
"@angular/common": "~12.0.2",
"@angular/compiler": "~12.0.2",
"@angular/core": "~12.0.2",

Can't use twice in same component

I want to use two email editor in same component.

<div class="container">
  <button (click)="exportHtml()">Export</button>
  <email-editor #editor1 (loaded)="editorLoaded($event)"></email-editor>
</div>

<div class="container">
  <button (click)="exportHtml()">Export</button>
  <email-editor #editor2 (loaded)="editorLoaded($event)"></email-editor>
</div>

@ViewChild(EmailEditorComponent)
private emailEditor: EmailEditorComponent;

If i am trying viewchildren instead of viewchild ,issue as editor is not defined is coming in console.

can someone guide or help?

Thanks in advance.

ProjectID / API Key

Hey guys,
What's the method in the angular implementation for passing the Project ID / ID / API Key on init?

Thanks!

How to call this following Init function angular

Screenshot from 2020-12-22 14-54-27

When I try to call tools or options object, the editor seems not working. I tried to adjust some settings in the ngOnInit() function, it says undefined. Then I try to use that load function, minHeight and loadDesign is working but tool or options are not working.
Screenshot from 2020-12-22 14-56-57

Any Idea why?

Thanks

Two way binding ngmodel is not working

This editor two way binding is not working how I am binding data in update time I need to display preview once user update data

ngModel and formcontrol is not working

<email-editor ngDefaultControl [(ngModel)]="emailTemplate.templatestring"
name="templatestring" #templatestring="ngModel" [ngClass]="{'is-invalid': f.submitted && templatestring.invalid}" />

HTML Design Upload

I want to load my HTML design like JSON of the template is it possible? Or it will possible?

AMP HTML Support

Does it provide AMP email support as well ?
I want it to be used as an AMP template generator.

TypeError: this.callbacks[i] is not a function

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.