> Hey. Due to the fact that I do not use Angular in my projects, I cannot fix plugin errors in a timely manner. If you want the plugin to develop, send PR or better become a contributor
onReady emits the Jodit instance once it is created. Every other output emits
{ args, editor }, where args are the arguments Jodit passed to the event:
Handlers are only attached to Jodit for outputs you actually bind, so unused events cost nothing.
Accessing the editor instance
@ViewChild(JoditAngularComponent) joditComponent!: JoditAngularComponent;ngAfterViewInit() { // may still be null right after view init, prefer (onReady) this.joditComponent.editor?.s.insertHTML('<b>hi</b>');}
Styles
The component bundles jodit/es2021/jodit.min.css with ViewEncapsulation.None, so no extra
setup is required. To use another theme or build, add it to styles in angular.json.
Custom Jodit build or Jodit PRO
Jodit is imported lazily from the jodit package. To use your own bundle, Jodit PRO or a
pre-configured Jodit class, provide it through JODIT_CLASS:
import { JODIT_CLASS } from 'jodit-angular';import { Jodit } from 'jodit-pro';bootstrapApplication(App, { providers: [{ provide: JODIT_CLASS, useValue: Jodit }],});
Server-side rendering
Nothing from Jodit is evaluated on the server. The editor is created in the browser after the
first render, so Angular Universal and prerendering work out of the box.
Development
npm cinpm start # demo app with the library linked from dist/npm test # karma + ChromeHeadlessnpm run build # builds dist/jodit-angular
Library sources live in projects/jodit-angular, the demo in projects/demo.
Release
Releases are built and published by GitHub Actions. Either run the New version workflow from
the Actions tab (choose patch, minor or major), or locally:
npm version patch # bumps both package.json files, updates CHANGELOG, commits and tagsgit push --follow-tags origin main
The release.yml workflow runs tests, publishes dist/jodit-angular to npm through OIDC
trusted publishing and creates a GitHub release from CHANGELOG.md.