observable

Send multiple asynchronous HTTP GET requests

半城伤御伤魂 提交于 2020-01-11 09:52:53
问题 I've got an API call that I need to make multiple times as the API doesn't support requests for multiple items. What I have written so far ends up in an endless loop of sending GET requests to the server. I believe I don't understand the nature of Observables in the below example. My assumption is that each call in the while loop subscribes to a new single object and that when it is resolved it will be placed in the array. How can I modify the below code to achieve what I want? getSingle():

Angular 5 getting array issue with data from service to component to template [duplicate]

ぐ巨炮叔叔 提交于 2020-01-11 03:41:08
问题 This question already has answers here : Data returning from api call through service to component is an object and seems to need to be an Array for Angular (2 answers) Closed 2 years ago . Trying to display data in template HTML from a component to service call which calls and returns an API, but I'm getting this error ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays. HTML <li *ngFor="let item of

JavaFX - TableView doesn't update items

非 Y 不嫁゛ 提交于 2020-01-07 03:21:12
问题 I'm programming a little vocabulary trainer for my wife using JavaFX. Each word stores it's own statistic values like how often she encountered the word and how often she provided a correct answer. I've set up a TableView for that, but after a training session the stats won't update. The word objects themselves have the right values but they're just not shown in the TableView. Usually the TableView always displays the current values of on object due to the nature of ObservableList, right? Not

Nativescript RadListView not binding to source property

梦想的初衷 提交于 2020-01-07 03:00:34
问题 I am trying to implement {N} telerik's UI RadListView. Here is their getting started guide, which I followed as a reference. I have setup the following XML layout : list.xml <StackLayout loaded="loaded" xmlns:lv="nativescript-telerik-ui/listview" xmlns="http://www.nativescript.org/tns.xsd"> <lv:RadListView items="{{ rankingsArray }}"> <lv:RadListView.listViewLayout> <lv:ListViewLinearLayout scrollDirection="vertical"/> </lv:RadListView.listViewLayout> </lv:RadListView> <lv:RadListView

Preventing breeze.js from creating observables properties on array objects

旧巷老猫 提交于 2020-01-06 13:55:56
问题 I must be missing something simple, but can't figure it out. I'm retrieving a bunch of lookup tables in 1 Web API call. return EntityQuery.from('Lookups') .noTracking(true) .using(manager).execute() .then(processLookups); In processLookups I'm calling getLocal for each array that was returned. Example: State table datacontext.lookups = { state: getLocal('States', orderBy.state, true), .... } function getLocal(resource, ordering, includeNullos) { var query = EntityQuery.from(resource) .orderBy

full calendar - passing event data from observable - not showing up on calendar

回眸只為那壹抹淺笑 提交于 2020-01-06 08:33:49
问题 I am using ap-fullcalendar for angular/typescript. I have a data service, where I get the events for the calendar from my database, I wrap the data in a Behaviour Subject and subscribe to it and make it into an observable from another function. I have a data service because I have multiple subscriptions to the same observable. In my component where the calendar is, I subscribe to the data. However, for some reason, the events are not getting passed properly to the calendar and won't show up.

ngFor over an array property of an observable [duplicate]

て烟熏妆下的殇ゞ 提交于 2020-01-06 05:37:05
问题 This question already has an answer here : Angular 5 - Observable return error cannot read property of undefined (1 answer) Closed last year . I have an object that I would like to use in a view component, PersistedWaitlist: export class PersistedWaitlist extends Waitlist implements Identifiable { private items: PersistedWaitlistItem[]; constructor(public readonly id: number, createdAt: Date, name: string) { super(createdAt, name); this.items = new Array(); } addItem(waitlistItem:

KnockoutJS - update observable from another modelview

余生颓废 提交于 2020-01-06 04:53:09
问题 I have an existing ComposePopupView() modelview which contains observable this.attachments = ko.observableArray([]); and a method below ComposePopupView.prototype.addDropboxAttachment = function (oDropboxFile) { var oAttachment = null, iAttachmentSizeLimit = Utils.pInt(Settings.settingsGet('AttachmentLimit')), mSize = oDropboxFile['bytes'] ; oAttachment = new ComposeAttachmentModel( oDropboxFile['link'], oDropboxFile['name'], mSize ); oAttachment.fromMessage = false; oAttachment.cancel = this

rxjs first operator is being repeatedly called?

末鹿安然 提交于 2020-01-05 07:44:18
问题 If I use, 2 gets printed to the console every 3 seconds: Rx.Observable.interval(3000) .mergeMap(() => Rx.Observable.of(3)) .concatMap(()=>Rx.Observable.of(2).first(x=>x == 2)) .subscribe((x)=>console.log(x)) If I use, 2 gets printed to the console only one time: Rx.Observable.interval(3000) .mergeMap(() => Rx.Observable.of(3)) .concatMap(()=>Rx.Observable.of(2)) .first(x=>x == 2) .subscribe((x)=>console.log(x)) The difference is where I chained the first operator, but I don't understand the

rxjs first operator is being repeatedly called?

点点圈 提交于 2020-01-05 07:44:11
问题 If I use, 2 gets printed to the console every 3 seconds: Rx.Observable.interval(3000) .mergeMap(() => Rx.Observable.of(3)) .concatMap(()=>Rx.Observable.of(2).first(x=>x == 2)) .subscribe((x)=>console.log(x)) If I use, 2 gets printed to the console only one time: Rx.Observable.interval(3000) .mergeMap(() => Rx.Observable.of(3)) .concatMap(()=>Rx.Observable.of(2)) .first(x=>x == 2) .subscribe((x)=>console.log(x)) The difference is where I chained the first operator, but I don't understand the