In the world of text editing, there is a new era of WYSIWYG (What You See Is What You Get). We all know how styling and formatting become the important elements of your website but most of the times it is tough to pick a simple, easy-to-use and powerful editor. Currently, the good days are coming back with the new Medium Editor!
You can also try to incorporate text editor into Angular 8 for the ease of updates and edits of your content. Angular 8 has released its latest feature – beta 6 with the attractive new functionalities for testing your software and fixing bugs. One of them is Bazel – Google’s open-source part of its internal build tool called Blaze which is capable of performing incremental builds and tests. Let us check how you can integrate a Medium editor in the Angular 8 platform.
Steps to create an editor using Angular 8
First thing first, Create a project in Angular and you can also make use of bootstrap for making it look pretty good by adding CDN links in the index.html
After entering the above-given command line, it will generate an angular starter application after it has completed installing all the dependencies.
Install an npm package by entering the below-given line.
And then, include the CSS and js in angular.json file
Create a component with your chosen name and then create the one with the name create
Click to the newly created component.html and make a div by giving it a template reference of the name
Try the above-given code snippet under a few bootstrap classes just to give a basic stylings
Select your component class and make a variable editor to view the child property as listed below:
Then, we will make use of one lifecycle hook of angular which is ngAfterViewInit.
Paste the above-given scrap and you may get a mistake like media supervisor that isn’t characterized all things considered, in this way, we have to declare it on the top like
In the wake of rolling out the above improvements, you can, for the most part, make a little medium-supervisor to utilize it for yourself.
You can pick over to compose anything and simply select the content you have written to see the enchantment.
After this, you may require some more alternatives in your editorial manager toolbar. For doing as such, you have to pass an arrangement object in the MediumEditor Constructor.
By making the selective changes, you will be able to see a load of available options.
So, now you have got an editor, you can easily get the data from it. If someone writes a post then you need to have an HTML write of the same. Once more, you have to partition the screen into two parts wherein one half, there will be a supervisor and the other half will show the see of the post.
[box type=”shadow” align=”” class=”” width=””]In the second half of the screen, you need to assign the value of inner HTML as given above[/box]
Every system is prone to pros and cons and so does the Angular too. Angular offers a clean code development along with the high-performance framework that manages to route, providing seamless updates using Command Line Interface and retrieving the state of location services. Also, you can debug the templates in Angular 8 and supports multiple applications in one domain.
Contrary to this, Angular might be confusing for the newcomers as there is no accurate manual which includes the proper documentation of the framework. Also, it lacks the developer community and there is limited scope to debug Limited Routing. However, Angular 8 supports multiple applications in one domain and user-friendly for all the versions of the operating system.
So, here we come to the end of the article. We hope you have gained information on how to integrate the latest medium editor to Angular 8. Do give it a try! Till then – keep learning!
Dave Jarvis is working as a Business Development Executive at eTatvaSoft.com, an enterprise-level mobile & web application development company. He aims to sharpen his analytical skills, deepening his data understanding and broaden his business knowledge in these years of his career. Click here to find more information about the company. Follow him on Twitter.