Relative Content

Tag Archive for angularrxjs

Why is chart not shown on page load?

Can someone help me with this one. I have a component where I want to show a chart from ng2-charts/chart.js. I wanted to make it a bit more reactive so therefore I wrote this:

Angular Observable firing twice, first one empty

I have a call in the constructor of a component to select an account (the store.dispatch is in ngOnInit) and it seems to emit two values, one empty, the next successful. The console.log in the code below will write twice to the console.

Angular 18 – RxJS : Subscribe is deprecated

Subscribe will be deprecated. The example I have seen on the RxJS website don’t really use any observers. If I remove subscribe from the following code, I get “error TS2349: This expression is not callable. [ng] Type ‘Observable’ has no call signatures.”

Persisting log-in session in angular using jwt

I am trying to create a login service that will keep track of whether a user is logged in or not. I have implemented a server which uses JWT’s and works correctly. I am now trying use my auth service/user service to drive aspects of the UI e.g show navigation menu items if the user is logged in or not. The issue I face is when the app is refreshed or rebuilt, it doesn’t seem to react to existing tokens stored in localstorage(this is a temporary solution whilst i build by app)