unlayer / angular-email-editor

Drag-n-Drop Email Editor Component for Angular
https://unlayer.com
MIT License
203 stars 166 forks source link

How to call this following Init function angular #39

Open fahim041 opened 3 years ago

fahim041 commented 3 years ago

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

wgbnyes commented 3 years ago

You need configure this in tools prop before viewInit, not in options prop, see below:

this.emailEditor.tools = {
  image: {
    enabled: false
  }
};
Navya-adft commented 3 years ago

@wgbnyes i need to add button click function in angular, how should i use,

unlayer.setLinkTypes([ { name: "static_google_link", label: "Go to Google", attrs: { href: "https://google.com/", target: "_blank" }, } ]);

supmanyu commented 2 years ago

Hi, I'm trying to pass the options object to the editor in angular, but the editor does not reflect the changes

<email-editor [appearance]="editorAppearance" [options]="options" [projectId]="82250" (ready)="editorReady($event)"></email-editor>

in component.ts:

 options: any = {
    features: {
      audit: true,
      userUploads: true,
      stockImages: {
        enabled: true,
        safeSearch: true,
      },
    }
  }