Hi Harry,

Do yourself a feature and spend a couple of hours on learning how the 
asynchronous code works in JS. First focus on understanding promises. 
Its a kind of an event system, and you only can access your "data" after 
the event is done.

The function you are showing is doing a load of things, What is missing is 
a way to tell it's "done". It tells that once upon a time in the future it 
will call `this.chooseScale` with the available devices. However, it does 
not tell you when this future is.
So if you call this, and then expect the result to be there right away, 
well, not gonna happen.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises
that link will give you some basics on promises. 

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to