search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Include library in angular with webpack

Asked by Praneeth
3 years ago.

I am evaluating your product using the trial version, and I am using webpack and angular 2+ for my application, and need to know what would be the way of how I could get a reference to the object in this library.

I know there is a version for anuglar 2+, but I noticed it does not have all the features of the JS library. Hence my effort to include the JS library with webpack instead of the angular 2+ version.

Could you kindly help me out here, my code is listed below,

///<reference path="../../js/daypilot-all.min.d.ts" />

import { Component, OnInit } from '@angular/core';
import DayPilot = require('../../js/daypilot-all.min.js');

@Component({
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit {
ngOnInit() {
var dp = new DayPilot.DayPilot.Scheduler("dp");

//dp is an empty object.
debugger;
}
}`

Answer posted by Dan Letecky [DayPilot]
3 years ago.

If you import DayPilotModule in your own module like this:

@NgModule({
  imports:      [
    // ...
    DayPilotModule
  ],
  // ...
})
export class SchedulerModule { }

You'll be able to import the "DayPilot" namespace:

import {DayPilot} from 'daypilot-pro-angular';

Then you can call the scheduler constructor:

var dp = new DayPilot.Scheduler("dp");
Comment posted by Dan Letecky [DayPilot]
3 years ago.

By the way, the Angular version should support all the features supported by the JavaScript version. Let me know if you have problems with any specific feature.

Comment posted by Praneeth
3 years ago.

Thanks! Its good to know all features are available in the angular version.
I tried it and it works fine! Will revert back to you guys if I need more help during the evaluation.

Best scheduling control BTW!

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.