QuickDEV
  • ▶️Quick start
    • 🔃Overview
    • 🔑Security
  • 🎭Users management
    • 👨‍👩‍👦‍👦Members and groups
    • 🔐Permission for resources
  • 🖥️Applications
    • ➕Create applications
      • ⤴️Create application/module
      • 🔲Module
      • ✅Version and Release Management
    • 🎨Application editor
      • 👁️‍🗨️Visual components
        • ⚙️Common component settings
        • ⬆️File upload
        • 📊Charts and graphs
        • 🌄Image
        • 📋Option lists
        • 📑List view
        • ⬜Drawer
        • 🗺️Google maps
        • 📩Messages / Toast
        • 📅Calendar
        • Custom component
      • #️⃣Use markdown
      • ⌨️Keyboard shortcuts
    • 🔗Navigation
    • ⏯️Actions editor
      • ⏱️Date handling
      • 🟰Data selection & JavaScript
      • ⚡Event handlers
      • 🔎JavaScript Query
      • ✖️Dynamic variable
      • 💱Transformers
      • 🧮Data responder
      • ↕️Built-in JS functions
      • 📚Third-party libraries
    • 🖌️Styling
      • 📝Themes
      • 🖍️Customize styles
  • 🚀Database & API
    • 🔎Queries
    • 🧰Query repository
    • 📡Datasources
      • 🌎API
        • 1️REST API
        • 2️GraphQL
        • 3️Google Sheets
      • 🟠SQL Databases
        • 1️Oracle
        • 2️Microsoft SQL Server
        • 3️MySQL
        • 4️PostgreSQL
        • 5️MariaDB
      • 🟡NoSQL Databases
        • 1️MongoDB
        • 2️CouchDB
        • 3️DynamoDB
      • 🔴REDIS
      • 🟢BigData & OLAP
        • 1️Big Query
        • 2️Snowflake
        • 3️ClickHouse
        • 4️Elasticsearch
      • 🌐WebSocket
  • 💻Integrations
    • 1️ANGULAR
    • 2️HTML Pages
Powered by GitBook
On this page
  1. Integrations

ANGULAR

PreviousIntegrationsNextHTML Pages

Last updated 3 months ago

It is also possible to integrate QuickDEV Apps and Modules with external Angular apps.

  1. Download QuickDEV SDK Library

  2. Create an angular project and install required libraries:

//create angular project
ng new project_name  

//change directory to project_name
cd project_name

//install quickdev_sdk library
npm install "path-to-sdk-library/quickdev-sdk-2.3.4.tgz"

//install react libraries
npm install react react-dom @types/react @types/react-dom
  1. Show module in your angular component. Check the following example:

app.component.html
<div class="quickdev-container">
</div>
app.component.ts
import { Component, ElementRef, OnInit, OnDestroy } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterOutlet } from '@angular/router';
import { bootstrapAppAt } from 'quickdev-sdk';

@Component({
selector: 'app-root',
standalone: true,
imports: [CommonModule, RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent implements OnInit, OnDestroy {
  private node: HTMLElement | null = null;
  private moduleId: string = '66229bb5ab398939c8eaa351'; //Change with module id that want to show in angular app
  private baseUrl: string = 'https://apps.quickdev.cloud';

  constructor(private elementRef: ElementRef) {
  }

  ngOnInit(): void {
    if (this.node) {
      this.node.remove();
    }

    const container = this.elementRef.nativeElement.querySelector('.quickdev-container');
    if (container) {
      this.node = document.createElement('div');
      container.appendChild(this.node);

      this.node.style.display = 'none';
      var options = { moduleInputs: {}, appDsl: '', moduleDslMap: '', baseUrl: this.baseUrl };
      var instance = bootstrapAppAt(this.moduleId, this.node, options) as Promise<any>;

      instance.then(x => {
        //outputChanged
        x.on("moduleOutputChange", (data: any) => {
          console.log(data);
        });

        //eventCalled
        x.on("moduleEventTriggered", (eventName: any) => {
          console.info("event triggered:", eventName);
        });

        this.delay(200).then(y => {
          if (this.node != null)
            this.node.style.display = 'block';

          //send input
          x.setModuleInputs({ moduleInput1: 'Data from angular' });

          //call method
          x.invokeMethod('method1');
        });
      });
    }
  }

  ngOnDestroy(): void {
    if (this.node) {
      this.node.remove();
    }
  }

  delay(ms: number) {
    return new Promise(resolve => setTimeout(resolve, ms));
  }
}
💻
1️
Create a module
Publish the module
Share the published module
5MB
quickdev-sdk-2.3.4.tgz