3

I've create an app in angular 2 that has a few modules using 1 shared module for it's utilities. This app is hosted in an iis asp.net web site and the source code is managed on TFS.

Now that this site is up and running, I want to be able to create another site with an app that uses the same shared module. Changes to the shared module should be reflected in both sites.

If this was .net and C# I'd use a 3rd project as a common library. What is the best practice in angular 2 / typescript

user355289
  • 1,100
  • 2
  • 13
  • 23
  • deploy it as a private repository and use ssh to configure as a node_module. Refer this [**answer**](https://stackoverflow.com/questions/7575627/can-you-host-a-private-repository-for-your-organization-to-use-with-npm) – Aravind Aug 04 '17 at 17:38
  • I manage my code C# and web in TFS (located on our company's servers), will this solution require me to move part of the code out of TFS? – user355289 Aug 04 '17 at 19:18
  • by C# code? what you mean? what is the expectation? some service calls generically or ?? – Aravind Aug 04 '17 at 19:19
  • I am asking if moving this shared module from both websites and putting it in deploy-able node module, would require me to manage it's source code outside of TFS (where the majority of my code is) – user355289 Aug 04 '17 at 20:09
  • @Aravind `deploy it as a private repository` wow, and every time I make a change to a common module I will have to publish and update each project. Really?? – Toolkit Jul 03 '18 at 09:56
  • @Toolkit yes you should be having it as a private repo. you can have a CI/CD for deploying it for every changes. Hope that helps you – Aravind Jul 03 '18 at 10:12
  • @Aravind but why would anyone opt for such a painful solution?? Any decent framework offers a better one, take .NET, Java etc – Toolkit Jul 03 '18 at 10:21
  • @Aravind and that means also I have to go through npmjs npmjs.com site and subscribe there? – Toolkit Jul 03 '18 at 10:22
  • @Toolkit you can also try out `nrwl` `nx` framework alternatively – Aravind Jul 03 '18 at 10:22
  • and what about debugging? Let's say I have a web client, web api and some shared lib, how do I debug it together? – Toolkit Jul 03 '18 at 10:35
  • Seems reasonable to expect to be able to share code easily between two angular projects. – fcs Jan 28 '19 at 23:50

0 Answers0