Relative Content

Tag Archive for angular

How can I reuse an Angular subscribe function?

How can I reuse a subscribe function to update data, since I need to perform actions after the result of the call in another function? Do I need to do another subscribe? Naturally, I can’t use async/await to make the process wait, I put the code like this because that’s how it was with fetch before.

Angular: ng build not putting components in dist folder

I’ve build an angular application which is working as expected with ng serve.
When using ng build, i get the project in the dist file. But all the components are missing. I only get the images folder from the assets, and files like the index.html, main.js, polyfill.js etc. But all my component folders are missing.

NG0203 injection problem when building multi-project app

I have a multi project app in angular.
I’ve added config files to one of the inner project
and get NG0203 inject() must be called from an injection context when trying to load the route I’m going to.
This only happens with the project I actually recreated to be standalone apps. I added preserverSymslinks:true but nothing works.
Please let me know if you need certain config files.
I think the multi project app is called a mono repoo. I’ve added package.json to it also node_modules etc… in order it to be individualized.Apparently I shoudln’t do that but I didn’t found a way to do it differently.it works when using ng serve