You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/partials/integrations/angular-quick-start.adoc
+65-47Lines changed: 65 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
:packageName: tinymce-angular
2
2
3
-
The https://github.com/tinymce/tinymce-angular[Official {productname} Angular component] integrates {productname} into Angular projects. This procedure creates a https://angular.io/guide/setup-local[basic Angular application] containing a {productname} editor.
3
+
The https://github.com/tinymce/tinymce-angular[Official {productname} Angular component] integrates {productname} into Angular projects. This procedure creates a https://angular.dev/tools/cli/setup-local[basic Angular application] containing a {productname} editor.
4
+
5
+
This procedure uses standalone components. If using Angular Modules, see xref:angular-modules[Angular Modules].
4
6
5
7
For examples of the {productname} Angular integration, visit https://tinymce.github.io/tinymce-angular/[the tinymce-angular storybook].
* To load TinyMCE when the editor is initialized (also known as lazy loading), add a dependency provider to the module using the `+TINYMCE_SCRIPT_SRC+` token.
93
+
* To load {productname} when the editor is initialized (also known as lazy loading), add a dependency provider to the component using the `+TINYMCE_SCRIPT_SRC+` token.
100
94
+
101
95
[source,ts]
102
96
----
103
-
import { EditorModule, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
97
+
import { EditorComponent, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
.. Update the editor configuration to include the `+base_url+` and `+suffix+` options.
125
118
+
126
-
[source,html]
119
+
[source,ts]
127
120
----
128
-
<editor [init]="{
129
-
base_url: '/tinymce', // Root for resources
130
-
suffix: '.min' // Suffix to use when loading resources
131
-
}"></editor>
121
+
export class AppComponent {
122
+
/* ... */
123
+
init: EditorComponent['init'] = {
124
+
/* ... */
125
+
base_url: '/tinymce', // Root for resources
126
+
suffix: '.min' // Suffix to use when loading resources
127
+
};
128
+
}
132
129
----
133
130
endif::[]
134
131
ifeval::["{productSource}" == "zip"]
@@ -143,8 +140,6 @@ To use an independent deployment of {productname}, add a script to either the `+
143
140
<script src="/path/to/tinymce.min.js"></script>
144
141
----
145
142
+
146
-
To use an independent deployment of {productname} with the create a Angular application, add the script to `+/path/to/tinymce-angular-demo/src/app/app.component.html+`.
147
-
+
148
143
* Bundling {productname} with the Angular application using a module loader (such as Webpack).
149
144
+
150
145
--
@@ -174,7 +169,7 @@ endif::[]
174
169
175
170
== Deploying the application to a HTTP server
176
171
177
-
The application will require further configuration before it can be deployed to a production environment. For information on configuring the application for deployment, see: https://angular.io/guide/build[Angular Docs - Building and serving Angular apps] or https://angular.io/guide/deployment[Angular Docs - Deployment].
172
+
The application will require further configuration before it can be deployed to a production environment. For information on configuring the application for deployment, see: link:https://angular.dev/tools/cli/build[Angular Docs - Building Angular Apps] or link:https://angular.dev/tools/cli/deployment[Angular Docs - Deployment].
178
173
179
174
To deploy the application to a local HTTP Server:
180
175
@@ -190,10 +185,33 @@ The application has now been deployed on the web server.
190
185
191
186
NOTE: Additional configuration is required to deploy the application outside the web server root directory, such as +http://localhost:<port>/my_angular_application+.
192
187
188
+
[[angular-modules]]
189
+
== Angular Modules
190
+
`+EditorModule+` is available to import from `+@tinymce/tinymce-angular+`. Which should be included in your `+my.module.ts+` file.
191
+
192
+
[source,ts]
193
+
----
194
+
import { NgModule } from '@angular/core';
195
+
import { EditorModule, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
196
+
197
+
@NgModule({
198
+
/* ... */
199
+
imports: [
200
+
EditorModule
201
+
],
202
+
providers: [
203
+
// If you're self hosting and lazy loading TinyMCE from node_modules:
0 commit comments