Updated Article Available
This article is outdated and there is an updated article available.
Creating your First Angular Application
This tutorial shows how to create your first Angular application using TX Text Control DocumentViewer for Angular.
Create your free trial access token here:
Install Node.js® and npm, if not done before.
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
Open a Command Prompt and create a new project and default app by typing in the following command:
ng new my-viewer-app
Follow the questions in the command prompt by answering them with "y" to add Angular routing and Enter to confirm CSS as your preferred stylesheet format.
Change into the created folder by typing in the following command:cd my-viewer-app
Install the TX Text Control document editor package by typing in the following command:ng add @txtextcontrol/tx-ng-document-viewer
Open this folder in Visual Studio Code by typing in the following command:code .
In Visual Studio Code, open the file src -> app -> app.component.html, add the following code and save it. Replace yourtoken with your actual access token you created at the beginning of this tutorial.
Back in the command prompt, start the Angular application by typing in the following command:ng serve --open
Your default browser is opened with your created Angular app:
This tutorial uses a demo server backend for the required endpoints that is specified through the basePath attribute.
Creating Your Own Backend Server
To learn how to create your own Backend server project, please have a look at this tutorial:
You don't have to actually add a view to this backend server.
All available attributes for the Angular element are documented in the NPM package overview page:
╰ TXDocumentViewer Object