This document briefly describes the necessary steps to get started with Blueriq frontend development using the Angular framework from scratch. Below instructions are targeting Angular 6.
Working with a Blueriq frontend requires the following tools to be installed on your system.
You need Node.js to start developing an Angular application. Download the LTS version and run to installer. Alternatively, consider using NVM (for *nix or Windows) for running multiple versions of Node next to each other.
Verify that everything works by running node --version
followed by npm --version
. Both commands should complete successfully and show the respective tool versions.
The Angular team provides a tool to easily get started with Angular development, the Angular CLI. Install it using:
Verify that it works by running ng --version
.
To include the Blueriq libraries in your application, you need to add them to the package.json
file in the root of the project. This file describes all necessary dependencies to be installed.
The Blueriq library is bundled in multiple packages, @blueriq/core
and @blueriq/angular
. Add both to the list of "dependencies"
of package.json
with their latest version.
You must configure NPM to resolve the
@blueriq
libraries from Blueriq's private artifactory. See Artifactory documentation for details.
Also add the following dependencies that are required by Blueriq's Angular framework:
Now install the newly added dependencies using npm install
.
Please refer to the proxy configuration page for details on how to configure a proxy server to connect with a Blueriq Runtime.
Angular uses a modular system to define components and services, such that for example a certain feature can be self-contained within an Angular module. In @blueriq/angular
a module is provided that includes all required Blueriq functionality. Navigate to AppModule
and ensure it at least contains the below imports:
Also add a file dates.ts
that implements logic to parse and formats date. The following example is implemented using moment.js, but you can use any library you like.
We specify the baseUrl
as configuration of the V1BackendModule
, such that all Runtime calls will be using this base URL. The proxy configuration created earlier causes these requests to be proxied to the actual Runtime. To keep things simple, we use /Runtime
because that is what Blueriq Runtime uses as the default cookie-path if running on an application server such as Tomcat. Since our simple proxy server does not rewrite the cookie-paths in Blueriq's responses we must assure that we send all requests to /Runtime
as well in order for the Cookie to be passed by the browser.
Are you using a Blueriq version prior to 10.2? You'll have to switch to the legacy API endpoints by including the Angular module
LegacyBackendModule
from@blueriq/angular/backend/legacy
instead of using theV1BackendModule
.