├── src
├── assets
│ └── .gitkeep
├── app
│ ├── app.component.css
│ ├── app.component.html
│ ├── app.routes.ts
│ ├── code-editor-demo
│ │ ├── file-node.ts
│ │ ├── code-editor-demo.component.spec.ts
│ │ ├── code-editor-demo.component.html
│ │ ├── code-editor-demo.component.scss
│ │ ├── file-database.ts
│ │ └── code-editor-demo.component.ts
│ ├── app.component.ts
│ ├── app.component.spec.ts
│ └── app.config.ts
├── favicon.ico
├── tsconfig.app.json
├── main.ts
├── tsconfig.spec.json
├── styles.css
├── .browserslistrc
└── index.html
├── projects
├── multiple-editors
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── styles.css
│ │ ├── favicon.ico
│ │ ├── app
│ │ │ ├── app.component.css
│ │ │ ├── app.component.html
│ │ │ ├── app.component.ts
│ │ │ └── app.config.ts
│ │ ├── main.ts
│ │ └── index.html
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ └── .eslintrc.json
└── code-editor
│ ├── src
│ ├── lib
│ │ ├── code-editor
│ │ │ ├── code-editor.component.html
│ │ │ ├── code-editor.component.css
│ │ │ ├── code-editor.component.spec.ts
│ │ │ └── code-editor.component.ts
│ │ ├── editor-settings.ts
│ │ ├── models
│ │ │ └── code.model.ts
│ │ ├── services
│ │ │ ├── code-editor.service.spec.ts
│ │ │ ├── json-defaults.service.ts
│ │ │ ├── javascript-defaults.service.ts
│ │ │ ├── typescript-defaults.service.ts
│ │ │ └── code-editor.service.ts
│ │ ├── code-editor.module.ts
│ │ └── workers
│ │ │ └── typings-worker.js
│ └── public_api.ts
│ ├── ng-package.json
│ ├── tsconfig.lib.prod.json
│ ├── tsconfig.spec.json
│ ├── tsconfig.lib.json
│ ├── package.json
│ ├── .eslintrc.json
│ ├── LICENSE
│ └── README.md
├── .github
├── FUNDING.yml
├── dependabot.yml
└── workflows
│ └── pull-request.yml
├── .prettierrc
├── .vscode
└── settings.json
├── .editorconfig
├── .gitignore
├── cspell.json
├── .eslintrc.json
├── LICENSE
├── tsconfig.json
├── package.json
├── angular.json
└── README.md
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/projects/multiple-editors/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 | ## Installing
13 |
14 | ```sh
15 | npm install @ngstack/code-editor
16 | ```
17 |
18 | ## Integrating with Angular CLI project
19 |
20 | Import `CodeEditorModule` into your main application module:
21 |
22 | ```ts
23 | import { CodeEditorModule } from '@ngstack/code-editor';
24 |
25 | @NgModule({
26 | imports: [CodeEditorModule.forRoot()]
27 | })
28 | export class AppModule {}
29 | ```
30 |
31 | If you want to use a specific version of the Monaco editor, use `editorVersion` parameter.
32 | If not provided, the component is always going to use the `latest` version.
33 |
34 | ```ts
35 | @NgModule({
36 | imports: [
37 | CodeEditorModule.forRoot({
38 | editorVersion: '0.44.0'
39 | })
40 | ]
41 | })
42 | export class AppModule {}
43 | ```
44 |
45 | Update template to use the `ngs-code-editor`:
46 |
47 | ```html
48 |
10 |
11 |
12 | ## Installing
13 |
14 | ```sh
15 | npm install @ngstack/code-editor
16 | ```
17 |
18 | ## Integrating with Standalone Angular Project
19 |
20 | Update the `app.config.ts` file to provide the code editor configuration:
21 |
22 | ```ts
23 | export const appConfig: ApplicationConfig = {
24 | providers: [
25 | provideZoneChangeDetection({ eventCoalescing: true }),
26 | provideRouter(routes),
27 | provideAnimationsAsync(),
28 |
29 | // Configure Code Editor
30 | provideCodeEditor({
31 | // editorVersion: '0.46.0',
32 | // use local Monaco installation
33 | baseUrl: 'assets/monaco',
34 | // use local Typings Worker
35 | typingsWorkerUrl: 'assets/workers/typings-worker.js'
36 | })
37 | ]
38 | };
39 | ```
40 |
41 | ## Integrating with Modules-based Angular Project
42 |
43 | Import `CodeEditorModule` into your main application module:
44 |
45 | ```ts
46 | import { provideCodeEditor } from '@ngstack/code-editor';
47 |
48 | @NgModule({
49 | providers: [provideCodeEditor()]
50 | })
51 | export class AppModule {}
52 | ```
53 |
54 | If you want to use a specific version of the Monaco editor, use `editorVersion` parameter.
55 | If not provided, the component is always going to use the `latest` version.
56 |
57 | > For a full list of Monaco versions and changes, please refer to the official [CHANGELOG.md](https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md) file
58 |
59 | ```ts
60 | import { provideCodeEditor } from '@ngstack/code-editor';
61 |
62 | @NgModule({
63 | providers: [
64 | provideCodeEditor({
65 | editorVersion: '0.44.0'
66 | })
67 | ]
68 | })
69 | export class AppModule {}
70 | ```
71 |
72 | Update template to use the `ngs-code-editor`:
73 |
74 | ```html
75 |