Official CKEditor 5 rich text editor component for Angular 13+.
See the "Rich text editor component for Angular" guide in the CKEditor 5 documentation to learn more:
- Quick start
- Integration with
ngModel - Supported
@Inputproperties - Supported
@Outputproperties - Styling
- Localization
Because of the breaking changes in the Angular library output format, the @ckeditor/ckeditor5-angular package is released in the following versions to support various Angular ecosystems:
| Package version | Angular version | Details |
|---|---|---|
| Actively supported versions | ||
^7 |
13+ |
Changes in peer dependencies. (issue) |
| Past releases (no longer maintained) | ||
^6 |
13+ |
Requires CKEditor 5 at least in version 37. |
^5 |
13+ |
Requires Angular at least in version 13+. Lower versions are no longer maintained. |
^4 |
9.1+ |
Requires CKEditor 5 at least in version 34. |
^3 |
9.1+ |
Requires Node.js at least in version 14. |
^2 |
9.1+ |
Migration to TypeScript 4. Declaration files are not backward compatible. |
^1 |
5.x - 8.x |
Angular versions are no longer maintained. |
Note that the package.json file used in the main repository isn't published on npm (the production one is present in src/ckeditor/package.json).
After cloning this repository, install necessary dependencies:
npm installThis repository contains the following code:
./src/ckeditorcontains the implementation of the<ckeditor>component,./src/appis a demo application using the component.
Note: The npm package contains a packaged component only.
First, the CKEditor 5 build should be created out of source files:
npm run build-ckeditorTo open the demo application using the component, run:
npm run startTo test it in production, use:
npm run start -- --configuration productionTo run unit tests, use:
npm run testTo run e2e tests, run:
# Prepare the server.
npm run start
# Then, start tests.
npm run test:e2eTo run coverage tests, run:
npm run coveragePlay with the application and make sure the component works properly.
npm run changelogNote This step is required to test the package used as an npm dependency.
This project uses ng-packagr to create the package meeting the Angular Package Format specification.
Calling:
npm run build-packagecreates a package in the ./dist directory, which can be then published in the npm registry.
To test the ckeditor5-angular package, first bootstrap an empty Angular package using ng new and add the <ckeditor> component by following the guide.
Then, create a symlink to the ckeditor5-angular/dist package directory to test the ckeditor5-angular component via this repository.
ln -s path/to/ckeditor5-angular/dist node_modules/\@ckeditor/ckeditor5-angularMake sure that the preserveSymlinks option is set to true for the build architect in angular.json:
{
"project-name": {
"architect": {
"build": {
"options": {
"preserveSymlinks": true
}
}
}
}
}Make sure to test the package with the production setup (ng build --configuration production) and with older Angular versions (at least with the 9.1).
To create the release directory, run:
npm run release:prepare-packagesThen, to publish the new package in the npm registry, run:
npm run release:publish-packagesLicensed under the terms of GNU General Public License Version 2 or later. For full details about the license, please check the LICENSE.md file.