According to "From smalltalk to javascript and back", if I want to call method 'doNextTrack' in 'Myapp', I can do this:
--
Just like in the loader where you do this:
But it's not working for me. I know 'start' is a class-side method, but that shouldn't matter, right? So what am I doing wrong? You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Richard Eng wrote: > According to "From smalltalk to javascript and back", if I want to > call method 'doNextTrack' in 'Myapp', I can do this: > > || > require("amber/helpers").globals.Myapp._doNextTrack(); > > Just like in the loader where you do this: > > || > amber.globals.Myapp._start(); > > But it's not working for me. I know 'start' is a class-side method, > but that shouldn't matter, right? So what am I doing wrong? Why do you think that shouldn't matter? In fact, nothing matters more. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
I gather, then, that 'amber.globals.Myapp' is referring to the class, so _start() can be invoked. And _doNextTrack() must be invoked from the instance of Myapp. Is that correct?
-- Where can I find the Myapp instance? On Friday, 24 July 2015 05:51:31 UTC-4, Herby wrote:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Richard Eng wrote: > I gather, then, that 'amber.globals.Myapp' is referring to the class, so > _start() can be invoked. And _doNextTrack() must be invoked from the > /instance/ of Myapp. Is that correct? > > Where can I find the Myapp instance? Nowhere, unless you store it somewhere. I think the need to do this shows some design problem. See augmentPage method in pristine project - it sets up callbacks that need to do things for a Myapp instance without actual need to publish it. I think the call to doNextTrack is also needed more-or-less as a reaction to some event (broad meaning of a word), which should be also done by Smalltalk installing the callback itself to appropriate place (not trying to get in from JS side). Ideally, the Myapp._start() call should be only use of globals and the pieces of an app can then talk to each other (import vars FTW). > On Friday, 24 July 2015 05:51:31 UTC-4, Herby wrote: > > > > Richard Eng wrote: > > According to "From smalltalk to javascript and back", if I want to > > call method 'doNextTrack' in 'Myapp', I can do this: > > > > || > > require("amber/helpers").globals.Myapp._doNextTrack(); > > > > Just like in the loader where you do this: > > > > || > > amber.globals.Myapp._start(); > > > > But it's not working for me. I know 'start' is a class-side method, > > but that shouldn't matter, right? So what am I doing wrong? > > Why do you think that shouldn't matter? > > In fact, nothing matters more. > > -- > You received this message because you are subscribed to the Google > Groups "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [hidden email] > <mailto:[hidden email]>. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Okay, thanks. These are wise words.
-- On Friday, 24 July 2015 09:10:30 UTC-4, Herby wrote:
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |