Add external JavaScript libraries


I’m looking for a good tutorial on how to add external JavaScript libraries.


Most of the time this question is asked here, it’s because somebody is unfamiliar with Ionic, and wants to use things from their old jQuery comfort zone. If you can explain what external library you need, maybe it will help advance the conversation to help you out, but in general, especially if you’re just starting out, doing absolutely everything you can to use only things that (a) can be easily installed via npm, and (b) are designed to work in Angular2 environments will make your life a lot easier.


I’m trying to add dhtmlx scheduler library in my project. Can you help ?


Maybe you could try following this?


I did but it didn’t work for the schedule component. I just want to ask you a question, you seem experienced. Is it always a mess when trying to add a library that doesn’t have an angular version? I mean there is basically no documentation at all.


Generally, yes, because of how events, change detection, and DOM management are controlled. It’s theoretically possible to have Angular-unaware components be black boxes that handle all that stuff internally, but integrating it in such a way as to filter information into and out of there and back into Angular-land is fairly tricky, especially if you’re not used to doing it.


Yea I mean I managed so far to add 2 "tricky libraries " in my Ionic project and they both have different “tricks” to import, that I didn’t find in any stackoverflow post or github or freecampcode or anywhere it’s just mere luck!!
Anyway thanks for the help I m closing this!


So did you publish your findings somewhere after you got it working?
(The forum has a nice “demo” category where you could something like this, then Google will find and index it an other people can find it in the future)


@Sujan12 Alright can you show me where? I’ll try my best to contribute


Just write a new topic here and describe what you did:


Did you manage to get the scheduler to work? I’m currently having a similar battle.


Don’t bother it’s not working properly on mobile


Do you have any recommendations on what else to use?


Honestly after dhtmlx I tested Ionic2-calendar it works fine & it’s easy to add but it doesn’t offer the same options as dhtmlx. So in the end I created my own scheduler component.