Relative Content

Tag Archive for javascriptangulartypescript

Angular and RxDB infinite loop

In the component I have a simple table were one of the columns calls a function getOrderItems() to get order corresponding items:

wait a function to finish

The general use case for waiting for a function to finish is to use async-await and Promise. But somehow I can’t get it to work.

How can i fix the event index issue in my angular drag-and-drop?

This is a rought draft of a trello clone. A UI that lets you drag around lists and cards, and move cards between lists. The drag events are having issues because it seems like the indexes for the dragged cards are being generated at the board level instead of the list level. If you drag card 5 to drop just below card 1, it will jump to the bottom of the list. If you drag card 1 to just below card 6, the wrong card drops. Live code / demo here: https://stackblitz.com/github/HokieBytes/board-app?file=src%2Fapp%2Fboard%2Fboard.component.html

How do I wait for an HttpClient subscription to wrap up before returning the data in Angular 18

I’m working with Angular 18 and I’m trying to query data from an API so I can store it inside my component. I’m able to successfully console.log the API data stored in my object with both my component and the service that I’m using to retrieve the data. However, whenever I try to console.log its key or any of its values on their own, undefined shows up in the console. In addition, using Object.keys with the object returns an empty array.