This is a semi-strange problem.
I've got an Angular 4 project with a bunch of external libraries. The one I'm referencing here in particular is the PrimeNG library. More specifically, the Schedule portion which is essentially FullCalendar.
I need to extend this functionality, but I absolutely cannot figure out how to extend the Schedule prototype. If I go into the schedule.js file inside node_modules and edit the file directly, this is easy. I type:
Schedule.prototype.refreshEvents = function() { **do things** };
But obviously I don't want to have to modify anything in node_modules directly as it will just get replaced next update (and I can't distribute easily to my team).
I've tried declaring it in the component (at various lifecycle hooks), I've tried declaring it in a in index.html, and more. I'm just not sure what to do here.
Is there any way to extend the functionality of a node_modules plugin like this without directly modifying the file?
Thanks!
MySchedule extends Schedule. I haven't actually done that before myself, but I feel like that's a good place to start. I'll link the source code for Schedule from their github here. github.com/primefaces/primeng/blob/master/src/app/components/…