ngx-onlyoffice
This ONLYOFFICE wrapper for Angular displays the ONLYOFFICE viewer or editor in your Angular application.
Note, that you have to host the server yourself.
Installation
Type npm i ngx-onlyoffice
in your command prompt.
Usage
See below or refer to the example.
Include the module in your app.module.ts
.
;;; // <-- here;;
Use in your template:
An example config:
public myConfig =;
Config Changes
When you change the config, the editor will reload automatically. For this to work, you need to replace the entire config object. Just changing one property won't trigger a reload. Example:
// wrongthis.config.editorConfig.document.title = "New Title"; // rightthis.config = { editorConfig: { document: { title: "New title", ... }, ... }, ...}
Note that here you have to specify the whole configuration object, just some properties won't work.
However, if you just want to change some properties, you can use Object.assign
like so:
this.config = Object.assign({}, this.config, { editorConfig: { title: "New Title" }})
License
MIT