2021年2月4日星期四

What's the proper way to use Strapi with an Angular Workspace?

I'm creating a project where I'm using Strapi for a headless CMS and Angular for my client and admin apps. So far my project folder looks like this.

Project

  • Admin App
  • Client App
  • Strapi App
  • Libraries

I have them all synced together able to fetch and post respectively from each app. I decided I wanted to make an angular library, which is where the Libraries folder comes from and because I'm familiar with doing this in Nrwl I thought nothing of it and got an error telling me ng generate can only be used inside an angular workspace. So I deleted the Libraries folder and created an angular workspace with the name Libraries and inside of that created my library and it hit me, how do I use those libraries outside the workspace in my apps? So this leads me to wonder:

  1. Is there a way to expose those libraries and use them with the way my project is set up?
  2. Can I / Should I create the workspace and build the Strapi app inside of it?
  3. If both are possible what should I be thinking about in terms of deciding which would be best?

I know this isn't a direct question about a specific coding error, but it's hard finding info on these 2 things interfacing together. Let me know if there's anything else that will help.

https://stackoverflow.com/questions/65976615/whats-the-proper-way-to-use-strapi-with-an-angular-workspace January 31, 2021 at 03:11PM

没有评论:

发表评论