а

Adding Enterprise liscence to angular app


#1

I have my angular app that uses the latest gantt version.

I’m not sure where or how to add the enterprise license? Where can I do this? Also after downloading the files where can I find the enterprise licence?

I keep getting the error TS2304: Cannot find name ‘gantt’.

import { Component, ElementRef, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import "scripts/thirdParty/dhtmlxGantt/codebase/dhtmlxgantt.css";
import "dhtmlx-gantt";
import { GanttPropertyService } from '../services/gantt/ganttPropertyService';

@Component({
  encapsulation: ViewEncapsulation.None,
  selector: 'gantt',
  templateUrl: './gantt.component.html',
  styleUrls: ['./gantt.component.css'],
  providers:  [ GanttPropertyService ]
})


export class GanttComponent implements OnInit {
  @ViewChild("gantt_here", {static: true}) ganttContainer: ElementRef;

  constructor(private ganttPropertyService: GanttPropertyService) { 
    
  }


  ngOnInit(){
    this.ganttPropertyService.init(gantt);
    gantt.init(this.ganttContainer.nativeElement);
  }
}

#2

Hello,

We don’t have an NPM package of the Pro version. But you can install Gantt as an NPM package the following way:

  1. Unpack Gantt to a specific folder, for example, to /opt/gantt_pro
  2. If your Gantt version is 6.1.x, you need to replace the package.json file with the following one:
    https://files.dhtmlx.com/30d/cb80c0faf513b1caab81d79fe9266c4e/package.json
  3. Use the following command to install Gantt:
npm install /opt/gantt_pro

You can read more about installation methods in the following article:
https://docs.dhtmlx.com/gantt/desktop__install_with_bower.html#addingproeditionintoproject


Also after downloading the files where can I find the enterprise licence?

The files themselves are located in the codebase folder. But if you install Gantt as described above, you probably won’t need to install them separately.


#3

Thanks! That helped a lot!