Facing issue while using in Ionic 2
Closed this issue · 7 comments
Hi,
This seems to be clean & neat rich text editor component.
I would like to use in ionic 2. But, I am facing issues.
'trumbowyg' is not a known element
Kindly Let me know, how can we use this.
Thanks,
I just tested and it works with Ionic 3
Maybe it's because you didn't import TrumbowygModule.
First, I would like to thank you for immediate response.
All of a sudden!!!, it worked neatly today.
- Just created new sample tab ionic app.
- npm install ng2-lazy-trumbowyg --save
- import in app.module.ts
- Insterted the
<trumbowyg liveUpdate="true" [initialContent]="initialContentTwo" [options]="options2" (savedContent)="contentTwo=$event"> </trumbowyg>
in home template. - declaring the values for options & initialContent in home ts file.
Worked perfectly today.
I m confused, why i got the errors yesterday, where i followed same steps couple of times.
Thank you and good to know that it works now.
Hi,
Need below clarification.
<trumbowyg liveUpdate="true" [initialContent]="this.varname" [options]="optionsval" >
How to update the value of "varname". & how to trigger the method during value change.
savedContent
savedContent is used to update the value.
I would like to trigger method during onchange [ie., while editing] in text editor. What is the possibility.
Why are you trying to change initialContent which is varname in you case? It's just an initial string. You can do this
<trumbowyg liveUpdate="true"
[initialContent]="varname"
[options]="optionsval"
(savedContent)="convertThisToThat($event)">
<div [innerHTML]="content"></div>
convertThisToThat(ev) {
this.content = ev.replace(/This/gi, 'That');
}
or use pipe
<div [innerHTML]="content | highlight: 'title'"></div> //'title' text will be highlighted
Thanks for the inputs. Its very useful.