How to access globals from JS (was: Re: [amber-lang] A Word of Encouragement)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to access globals from JS (was: Re: [amber-lang] A Word of Encouragement)

Herby Vojčík


H. Hirzel wrote:
 > Hello Tim
 >
 > On 4/14/14, Tim Mackinnon<[hidden email]>  wrote:
 >> I've reported my results (success).
 >
 > Good.
 >
 >> So in the new world - where loading and dependencies are created via
grunt
 >> and bower - how will I get my stub counter example?
 >
 > Add
 > <button
onclick="require('amber_vm/smalltalk').Counter._tryExample()">Counter</button>

A bit of technical nitpick... amber_vm/xxx are not encouraged to use, as
they are deemed internal. Moreover, globals (like classes) are still
accessible at the old place (for backward compatibility), but they
reside in different, dedicated place for globals (that's what a warning
line about ClassName in js console is about)..

That onclick should contain
"require('amber/helpers').globals.Counter._tryExample".

--
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.
Reply | Threaded
Open this post in threaded view
|

Re: How to access globals from JS (was: Re: [amber-lang] A Word of Encouragement)

Tim Mackinnon
Ah - now that is a very good point to note - no sense in me learning any bad habits at the beginning ;)

Thanks for all the tips, I’m keen to kickstart my new level of learning.

Tim

On 14 Apr 2014, at 19:16, Herby Vojčík <[hidden email]> wrote:

>
>
> H. Hirzel wrote:
> > Hello Tim
> >
> > On 4/14/14, Tim Mackinnon<[hidden email]>  wrote:
> >> I've reported my results (success).
> >
> > Good.
> >
> >> So in the new world - where loading and dependencies are created via grunt
> >> and bower - how will I get my stub counter example?
> >
> > Add
> > <button onclick="require('amber_vm/smalltalk').Counter._tryExample()">Counter</button>
>
> A bit of technical nitpick... amber_vm/xxx are not encouraged to use, as they are deemed internal. Moreover, globals (like classes) are still accessible at the old place (for backward compatibility), but they reside in different, dedicated place for globals (that's what a warning line about ClassName in js console is about)..
>
> That onclick should contain "require('amber/helpers').globals.Counter._tryExample".
>
> --
> 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.

--
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.