Skip to content

Commit 73f7b16

Browse files
DOC-3182: update angular integration docs
1 parent cc2220f commit 73f7b16

File tree

2 files changed

+57
-56
lines changed

2 files changed

+57
-56
lines changed

modules/ROOT/partials/integrations/angular-quick-start.adoc

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This procedure requires https://nodejs.org/[Node.js (and npm)].
1212

1313
== Procedure
1414

15-
. On a command line or command prompt, install the https://angular.io/cli[Angular CLI Tool] package.
15+
. On a command line or command prompt, install the https://angular.dev/tools/cli[Angular CLI Tool] package.
1616
+
1717
[source,sh]
1818
----
@@ -31,20 +31,20 @@ ng new --defaults --skip-git tinymce-angular-demo
3131
cd tinymce-angular-demo
3232
----
3333
ifeval::["{productSource}" == "package-manager"]
34-
. Install the `+tinymce+` and `+tinymce-angular+` packages and save them to your `+package.json+` with `+--save+`.
34+
. Install the `+tinymce+` and `+tinymce-angular+` packages and save them to your `+package.json+`.
3535
+
3636
[source,sh]
3737
----
38-
npm install --save tinymce @tinymce/tinymce-angular
38+
npm install tinymce @tinymce/tinymce-angular
3939
----
4040

4141
endif::[]
4242
ifeval::["{productSource}" != "package-manager"]
43-
. Install the `+tinymce-angular+` package and save it to your `+package.json+` with `+--save+`.
43+
. Install the `+tinymce-angular+` package and save it to your `+package.json+`.
4444
+
4545
[source,sh]
4646
----
47-
npm install --save @tinymce/tinymce-angular
47+
npm install @tinymce/tinymce-angular
4848
----
4949
endif::[]
5050
. Using a text editor, open `+/path/to/tinymce-angular-demo/src/app/app.component.ts+` and replace the contents with:
@@ -56,7 +56,6 @@ import { EditorComponent } from '@tinymce/tinymce-angular';
5656
5757
@Component({
5858
selector: 'app-root',
59-
standalone: true,
6059
imports: [EditorComponent],
6160
template: `
6261
<h1>{productname} {productmajorversion} Angular Demo</h1>
@@ -179,7 +178,7 @@ To deploy the application to a local HTTP Server:
179178
----
180179
ng build
181180
----
182-
. Copy the contents of the `+tinymce-angular-demo/dist+` directory to the root directory of the web server.
181+
. Copy the contents of the `+tinymce-angular-demo/dist/tinymce-angular-demo/browser+` directory to the root directory of the web server.
183182

184183
The application has now been deployed on the web server.
185184

@@ -189,6 +188,9 @@ NOTE: Additional configuration is required to deploy the application outside the
189188
== Angular Modules
190189
`+EditorModule+` is available to import from `+@tinymce/tinymce-angular+`. Which should be included in your `+my.module.ts+` file.
191190

191+
// TODO: make sure that I can remove it
192+
ifeval::["{productSource}" == "package-manager"]
193+
192194
[source,ts]
193195
----
194196
import { NgModule } from '@angular/core';
@@ -208,6 +210,27 @@ import { EditorModule, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
208210
export class MyModule {}
209211
----
210212

213+
endif::[]
214+
215+
ifeval::["{productSource}" != "package-manager"]
216+
217+
[source,ts]
218+
----
219+
import { NgModule } from '@angular/core';
220+
import { EditorModule } from '@tinymce/tinymce-angular';
221+
222+
@NgModule({
223+
/* ... */
224+
imports: [
225+
EditorModule
226+
],
227+
/* ... */
228+
})
229+
export class MyModule {}
230+
----
231+
232+
endif::[]
233+
211234
== Next Steps
212235

213236
* For examples of the {productname} integration, see: https://tinymce.github.io/tinymce-angular/[the tinymce-angular storybook].

modules/ROOT/partials/integrations/angular-tech-ref.adoc

Lines changed: 27 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Add the `+EditorModule+` to `+@NgModule({imports})+`:
8383
+
8484
[source,html]
8585
----
86-
<editor apiKey="test" [init]="{plugins: 'link'}"></editor>
86+
<editor apiKey="test" [init]="{plugins: 'link'}" />
8787
----
8888

8989
[[configuring-the-editor]]
@@ -104,7 +104,7 @@ The editor accepts the following properties:
104104
plugins=""
105105
tagName="div"
106106
toolbar=""
107-
></editor>
107+
/>
108108
----
109109

110110
None of the configuration properties are *required* for `+tinymce-angular+` to work. Specify a {cloudname} API key using `+apiKey+` to remove the `+This domain is not registered...+` warning message.
@@ -124,9 +124,7 @@ include::partial$misc/get-an-api-key.adoc[]
124124

125125
[source,html]
126126
----
127-
<editor
128-
apiKey="your-api-key"
129-
></editor>
127+
<editor apiKey="your-api-key" />
130128
----
131129

132130
[[licensekey]]
@@ -146,9 +144,7 @@ Use this when self-hosting {productname} instead of loading from {cloudname}. Fo
146144

147145
[source,jsx]
148146
----
149-
<Editor
150-
licenseKey='your-license-key'
151-
/>
147+
<editor licenseKey='your-license-key' />
152148
----
153149

154150
[[cloudchannel]]
@@ -174,7 +170,7 @@ Such as:
174170
<editor
175171
apiKey="your-api-key"
176172
cloudChannel="{productmajorversion}-dev"
177-
></editor>
173+
/>
178174
----
179175

180176
For information {productname} development channels, see: xref:editor-plugin-version.adoc#{productmajorversion}-{productmajorversion}-testing-and-{productmajorversion}-dev-release-channels[Specifying the {productname} editor version deployed from Cloud - dev, testing, and stable releases].
@@ -194,9 +190,7 @@ The `+disabled+` property can dynamically switch the editor between a "disabled"
194190

195191
[source,html]
196192
----
197-
<editor
198-
[disabled]="true"
199-
></editor>
193+
<editor [disabled]="true" />
200194
----
201195

202196
[[id]]
@@ -212,9 +206,7 @@ An id for the editor. Used for retrieving the editor instance using the `+tinymc
212206

213207
[source,html]
214208
----
215-
<editor
216-
id="uuid"
217-
></editor>
209+
<editor id="uuid" />
218210
----
219211

220212
[[init]]
@@ -237,7 +229,7 @@ For information on the {productname} selector (`+tinymce.init+`), see: xref:basi
237229
plugins: 'lists link image paste help wordcount',
238230
toolbar: 'undo redo | blocks | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | help'
239231
}"
240-
></editor>
232+
/>
241233
----
242234

243235
[[initialvalue]]
@@ -253,15 +245,13 @@ Initial content of the editor when the editor is initialized.
253245

254246
[source,html]
255247
----
256-
<editor
257-
initialValue="Once upon a time..."
258-
></editor>
248+
<editor initialValue="Once upon a time..." />
259249
----
260250

261251
[[inline]]
262252
=== `+inline+`
263253

264-
Used to set the editor to inline mode. Using `+<editor [inline]="true"></editor>+` is the same as setting `+{inline: true}+` in the {productname} selector (`+tinymce.init+`).
254+
Used to set the editor to inline mode. Using `+<editor [inline]="true" />+` is the same as setting `+{inline: true}+` in the {productname} selector (`+tinymce.init+`).
265255

266256
For information on inline mode, see: xref:inline-editor-options.adoc#inline[User interface options - `+inline+`] and xref:use-tinymce-inline.adoc[Setup inline editing mode].
267257

@@ -275,27 +265,23 @@ For information on inline mode, see: xref:inline-editor-options.adoc#inline[User
275265

276266
[source,html]
277267
----
278-
<editor
279-
[inline]="true"
280-
></editor>
268+
<editor [inline]="true" />
281269
----
282270

283271
[[plugins]]
284272
=== `+plugins+`
285273

286-
Used to include plugins for the editor. Using `+<editor plugins="lists code"></editor>+` is the same as setting `+{plugins: 'lists code'}+` in the {productname} selector (`+tinymce.init+`).
274+
Used to include plugins for the editor. Using `+<editor plugins="lists code" />+` is the same as setting `+{plugins: 'lists code'}+` in the {productname} selector (`+tinymce.init+`).
287275

288276
For information on adding plugins to {productname}, see: xref:work-with-plugins.adoc[Add plugins to {productname}].
289277

290-
*Type:* `+String+` or `+Array+`
278+
*Type:* `+String+`
291279

292280
==== Example: using `+plugins+`
293281

294282
[source,html]
295283
----
296-
<editor
297-
plugins="lists code"
298-
></editor>
284+
<editor plugins="lists code" />
299285
----
300286

301287
[[outputformat]]
@@ -313,15 +299,13 @@ Used to specify the format of the content emitted by the `+tinymce-angular+` com
313299

314300
[source,html]
315301
----
316-
<editor
317-
outputFormat="text"
318-
></editor>
302+
<editor outputFormat="text" />
319303
----
320304

321305
[[tagname]]
322306
=== `+tagName+`
323307

324-
Only valid when xref:inline[`+<editor [inline]="true"></editor>+`]. Used to define the HTML element for the editor in inline mode.
308+
Only valid when xref:inline[`+<editor [inline]="true" />+`]. Used to define the HTML element for the editor in inline mode.
325309

326310
*Type:* `+String+`
327311

@@ -334,13 +318,13 @@ Only valid when xref:inline[`+<editor [inline]="true"></editor>+`]. Used to defi
334318
<editor
335319
[inline]="true"
336320
tagName="my-custom-tag"
337-
></editor>
321+
/>
338322
----
339323

340324
[[toolbar]]
341325
=== `+toolbar+`
342326

343-
Used to set the toolbar for the editor. Using `+<editor toolbar="bold italic"></editor>+` is the same as setting `+{toolbar: 'bold italic'}+` in the {productname} selector (`+tinymce.init+`).
327+
Used to set the toolbar for the editor. Using `+<editor toolbar="bold italic" />+` is the same as setting `+{toolbar: 'bold italic'}+` in the {productname} selector (`+tinymce.init+`).
344328

345329
For information setting the toolbar for {productname}, see: xref:toolbar-configuration-options.adoc#toolbar[User interface options - toolbar].
346330

@@ -355,7 +339,7 @@ For information setting the toolbar for {productname}, see: xref:toolbar-configu
355339
<editor
356340
plugins="code"
357341
toolbar="bold italic underline code"
358-
></editor>
342+
/>
359343
----
360344

361345
[[using-the-ngmodel-directive]]
@@ -365,10 +349,10 @@ The `+ngModel+` directive can be added to use the editor in a form:
365349

366350
[source,html]
367351
----
368-
<editor [(ngModel)]="dataModel"></editor>
352+
<editor [(ngModel)]="dataModel" />
369353
----
370354

371-
For information on using `+NgModel+`, see: https://angular.io/api/forms/NgModel[Angular documentation - NgModel].
355+
For information on using `+NgModel+`, see: https://angular.dev/api/forms/NgModel[Angular documentation - NgModel].
372356

373357
[[modelevents]]
374358
=== `+modelEvents+`
@@ -387,9 +371,7 @@ Used to specify the events that trigger the `+NgModelChange+` to emit.
387371

388372
[source,html]
389373
----
390-
<editor
391-
modelEvents="change input nodechange undo redo"
392-
></editor>
374+
<editor modelEvents="change input nodechange undo redo" />
393375
----
394376

395377
[[using-with-reactive-forms]]
@@ -402,10 +384,10 @@ To use {productname} Angular component with reactive forms:
402384
+
403385
[source,html]
404386
----
405-
<editor [formControlName]="schema.key" [init]="{plugins: 'link'}"></editor>
387+
<editor [formControlName]="schema.key" [init]="{plugins: 'link'}" />
406388
----
407389

408-
For information on using reactive forms, see: https://angular.io/guide/reactive-forms[Angular documentation - Reactive Forms].
390+
For information on using reactive forms, see: https://angular.dev/guide/forms/reactive-forms[Angular documentation - Reactive Forms].
409391

410392
[[event-binding]]
411393
== Event binding
@@ -414,7 +396,7 @@ Functions can be bound to editor events, such as:
414396

415397
[source,html]
416398
----
417-
<editor (onSelectionChange)="handleEvent($event)"></editor>
399+
<editor (onSelectionChange)="handleEvent($event)" />
418400
----
419401

420402
When the handler is called (`+handleEvent+` in this example), it is called with an event containing two properties:
@@ -517,9 +499,7 @@ Used to provide an allow-list of valid events to trigger from the editor to the
517499

518500
[source,html]
519501
----
520-
<editor
521-
allowedEvents="onMouseDown,onKeyDown"
522-
></editor>
502+
<editor allowedEvents="onMouseDown,onKeyDown" />
523503
----
524504

525505
[[ignoreevents]]
@@ -537,7 +517,5 @@ Used to block a list of events from the `+tinymce-angular+` component.
537517

538518
[source,html]
539519
----
540-
<editor
541-
ignoreEvents="onMouseEnter,onMouseLeave,onMouseOut,onMouseMove"
542-
></editor>
520+
<editor ignoreEvents="onMouseEnter,onMouseLeave,onMouseOut,onMouseMove" />
543521
----

0 commit comments

Comments
 (0)