Products Technologies Demo Docs Blog Support Company

Getting Started: Document Editor Version 33.0 with Angular CLI 19.0

This article shows how to use the TX Text Control Document Editor version 33.0 npm package for Angular within an Angular CLI 19.0 application. It uses the trial backend running on our servers, but can also be used to get started with self-hosted applications.

Getting Started: Document Editor Version 33.0 with Angular CLI 19.0

This article explains how to use the Document Editor Angular component together with TX Text Control .NET Server 33.0.

Prerequisites

There are two ways to evaluate the TX Text Control Document Editor. You can either host your own backend by downloading the trial version of TX Text Control .NET Server, or by creating a trial access token to use a hosted backend, valid for 30 days:

Creating the Angular Application

This tutorial shows how to create your first Angular application using the TX Text Control document editor.

Prerequisites

  1. Create your free trial access token here:

    Create Access Token

  2. Install Node.js and npm, if not done before.

  3. Open a Command Prompt and install the Angular CLI globally by typing in the following command:

    npm install -g @angular/cli

This tutorial uses Visual Studio Code that can be downloaded for free.

Creating the Angular Project

  1. Open a command prompt and create a new project and default application by typing the following command

    ng new my-editor-app --no-standalone

    Follow the prompts, confirming CSS as your preferred stylesheet format and 'N' to disable server-side rendering and static page generation.

  2. Change to the folder that you created by typing the following command in the command prompt:

    cd my-editor-app
  3. Run the following command to install the TX Text Control document editor package:

    npm i @txtextcontrol/tx-ng-document-editor
  4. Open this folder in Visual Studio Code by typing in the following command:

    code .
  5. In Visual Studio Code, open the file src -> app -> app.module.ts, replace the complete content with the following code and save it:

    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { DocumentEditorModule } from '@txtextcontrol/tx-ng-document-editor';
    import { AppRoutingModule } from './app-routing.module';
    import { AppComponent } from './app.component';
    
    @NgModule({
      declarations: [
        AppComponent
      ],
      imports: [
        BrowserModule,
        AppRoutingModule,
        DocumentEditorModule
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }
  6. Open the file src -> app -> app.component.html, replace the complete content with the following code, replace yourtoken with your given Trial Access Token and save it:

    <tx-document-editor
      width="1000px"
      height="500px"
      webSocketURL="wss://backend.textcontrol.com/TXWebSocket?access-token=yourtoken">
    </tx-document-editor>

    Backend Server

    In the code above, a hosted demo backend server is used specified through the webSocketURL property. If you are hosting your own required backend server, replace the URL with your backend endpoint such as ws://localhost:8080/TXWebSocket.

  7. Back in the command prompt, start the Angular application by typing in the following command:

    ng serve --open

Next Steps

The following link takes you to a tutorial which shows how to use JavaScript to load documents and program the content of the document.

Programming the Angular Document Editor using JavaScript

This tutorial shows how to use the JavaScript API to manipulate the document by adding a table and inserting and modifying merge fields.

Read Tutorial

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Angular

Integrate document processing, editing, sharing, collaboration, creation, electronic signatures, and PDF generation into your Angular Web applications.

Learn more about Angular

Related Posts

AngularASP.NETJavaScript

Observe When the Reporting Preview Tab is Active Using MutationObserver

This article shows how to observe when the Reporting Preview tab is active using MutationObserver. The Reporting Preview tab is a feature of the TX Text Control Document Editor that allows you to…


AngularASP.NETJavaScript

Building an ASP.NET Core Backend Application to Host the Document Editor and…

This article explains how to create an ASP.NET Core backend application to host the Document Editor and Document Viewer. This backend application is required to provide the required functionality…


AngularJavaScriptDocument Editor

Getting Started: Document Editor with Angular CLI v17.0

This article shows how to use the TX Text Control Document Editor npm package for Angular within an Angular CLI v17.0 application. It uses the trial backend running on our servers, but can also be…


AngularJavaScriptDocument Editor

Angular: Loading Documents from Assets Folder on Initialization

Documents are typically loaded from a database, from an external blob storage, or from the file system of the server. This example shows how to load a binary document from the Assets folder into…


AngularJavaScriptDocument Editor

Getting Started: Document Editor with Angular CLI

This article shows how to use the TX Text Control Document Editor npm package for Angular within an Angular CLI application. This is the first course of a getting started series for Angular to…