Skip to content

Commit

Permalink
chore: angular 13
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerCodeMonkey committed Nov 4, 2021
1 parent 3c34b29 commit c2985dc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 53 deletions.
58 changes: 9 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,35 +55,35 @@ LTC Wallet Address:
<tbody>
<tr>
<td>
v12
v13
</td>
<td>
>= 14.0.0
>= 15.0.0
</td>
<td>
until Nov 11, 2022
until May, 2023
</td>
</tr>
<tr>
<td>
v11
v12
</td>
<td>
>= 13.0.0
>= 14.0.0
</td>
<td>
until May 11, 2022
until Nov 11, 2022
</td>
</tr>
<tr>
<td>
v10
v11
</td>
<td>
>= 12.0.0
>= 13.0.0
</td>
<td>
until Dec 24, 2021
until May 11, 2022
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -132,46 +132,6 @@ class YourModule { ... }

Nothing to do here :)

### ngx-quill v9

QuillJS (1.x) is directly using the `document`, `window`, `Node` and `navigator` context of the browser, when you require or import it.
To get things working in ssr you need to mock them on server side.

Change your `main.server.ts` to something like

```TS
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
// Mock all used objects and functions used by Quill
global['window'] = {}
global['document'] = {
createElement: () => ({
classList: {
toggle: () => {},
contains: () => {}
}
}),
addEventListener: () => {}
}
global['Node'] = {}
global['navigator'] = {}
export { AppServerModule } from './app/app.server.module';
export { renderModule, renderModuleFactory } from '@angular/platform-server';
```

The `quill-editor` and `quill-view` component of ngx-quill are doing the rest for you to check, if it is running on server- or browser side.
On server-side both components will not render or do anything, because they depend on QuillJS and so on the real browser environment.

**Hint:** Set `suppressGlobalRegisterWarning: true` in the global config to suppress quilljs warnings.

If you want to render your html content of the editor for seo purposes check out the `quill-view-html` component, that simply renders the html content :).

## Global Config

It is possible to set custom default modules and Quill config options with the import of the `QuillModule.forRoot()`.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@
"name": "Bengt Weiße"
}
],
"version": "15.0.0-0"
"version": "15.0.0"
}
2 changes: 1 addition & 1 deletion projects/ngx-quill/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/ngx-quill/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-quill",
"version": "15.0.0-0",
"version": "15.0.0",
"license": "MIT",
"author": {
"name": "Bengt Weiße"
Expand Down

0 comments on commit c2985dc

Please sign in to comment.