I find myself in a situation where I want/have to edit a template of a component, package imported by npm into my angular2 project.
I know that editing it inside /node_modules folder is a big 'no-no'. I would lose all my edits on 'npm install' or i have to add the whole /node_modules folder to my GIT project.
So how should i tackle this challenge.
In java world, I would extend the class, add and/or override stuff, and use my own 'child' class where I need it.
But what about angular 2 component templates??...
EDIT:
To clarify my comment @lexith
:
If you worked with Angular2 you should know what a component template is. The file with the same name but with .HTML extension. Now if I add a component through npm (ex.: ng-bootstrap, ngx-uploader....), and I need to edit the template or maybe the behavior(.ts file) a bit, how should one tackle that kind of challenge.
I could provide the code and specific package name, but how would this help? With the question, I try to understand the concept and implement it in several situations.
EDIT2:
I found a similar question here on SO. And I think I will implement the solution as proposed there.
Fork => Edit => Push => Import (from my git fork).`
But what a pain in the ass just to rearrange some HTML tags. Is this the only way to Rome?