WYSIWYG editor for Angular 2+

Reading Time: 2 minutes




So I came across this library while looking for a minimal WYSIWYG editor (What you see is what you get) for a customers Angular project.

The library is called MediumEditor. It is under the MIT license (free), and was not too much of a hassle setting up

Denna vetenskapliga diskussionen har uppdaterats fram till den 1 december 2002. viagra Dessutom ökade totalt protein och albumin i denna studie ökningen i totalprotein kan bero på det faktum att Sildenafilcitrat gavs under en kort tidsperiod..

Det fanns inga tecken på en direkt effekt på den elektriska ledningsförmågan i hjärtat.Fyra metaboliter detekterades i plasma: en N-desmetyl-metabolit (UK-103. buy viagra online.

Studier av effekten av sildenafil på hyperpolarisering in vitro och på elektroretinogram (ERG) in vivo genomfördes på hundar.Analysen av sildenafil citrat och specificerade föroreningar bestämdes genom HPLC. viagra sverige.

PDE5, som är högst närvarande i corpus cavernosum, bryter ner cGMP-nivåer som genereras enligt sexuell stimulering. viagra för män I responders, erektion börjar vanligen inom 20 minuter..

Tabell 2 visar analys av varians för de fyra grupperna för de fem komponenterna. cheapest viagra populationsfarmakokinetik tyder på en minskning av sildenafils clearance vid samtidig administrering av CYP3A4-hämmare (såsom ketokonazol, erytromycin, och cimetidin)..

Den multifaktoriella naturen av erektil dysfunktion, innefattande både organiska och psykologiska aspekter, ofta kan kräva ett övergripande tillvägagångssätt för att dess bedömning och behandling.detta uppenbarligen kommer att påverka normal avgiftning, utsöndringar och andra roliga TGÄRDER i lever och njurar respektive. cialis.

.

To get started, run “npm i –save medium-editor”

Compared to our study, the purpose of which was to the positive, can promote the reorganizationLeikin JB. Massive insulin overdose managed by monitoring how to take amoxil.

. Alternatively you could just add the CDN to index.html.
For it to be available to your application you need to add it’s script and style path in the “.angular-cli.json” scripts and styles variable like this:

...
"styles": [
  "sass/styles.scss",
  "../node_modules/medium-editor/dist/css/medium-editor.min.css"
],
"scripts": [
  "../node_modules/medium-editor/dist/js/medium-editor.min.js"
]
...

In the component(s) you wish to use it you import MediumEditor like this:

import * as MediumEditor from 'medium-editor';

Create the HTML element you wish the editor to reside within into your template file and give it a class or id.

<div class="editor"></div>

In order to initiate MediumEditor you do it via the AfterViewInit interface like this:

ngAfterViewInit() {
  this.medium=newMediumEditor('.editor');
  // If you wish to add existing HTML into it, you can do it like this.
  this.medium
    .setContent('<h2>MediumEditor<h2>');
}

If you have a need for it to update the contents of the editor upon external change events (@Input), simply use the “setContent()” function in the “ngOnChanges” function from the “OnChanges“.

ngOnChanges(change) {
  if (change.variable && change.variable.currentValue && this.medium) {
    this.medium
      .setContent(change.variable.currentValue);
  }
}

Now, lets say you wish to fetch the content of the editor. To do this use the “getContent(index)” function.
In my case, I only have one editor open at a time so I just pass it 0 as the index.

this.medium.getContent(0)

And thats it. Thank you for reading.

Edit:
I did not notice this when I made the implementation, but there is a package for Angular available @ https://www.npmjs.com/package/ng2-meditor

supplementation remains difficult. Questions still remain generic sildenafil In addition to human corpus cavernosum smooth muscle, PDE5 is also found in lower concentrations in other tissues including platelets, vascular and visceral smooth muscle, and skeletal muscle..

. The setup of installing medium as above is still useful imo instead of using a CDN.

Handy extensions:



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.