[英]How do I open the class browser with a specific class?
Amber Smalltalk version 0.13 琥珀色Smalltalk版本0.13
In this project I'd like to open the class browser with a specific class. 在这个项目中,我想用特定的类打开类浏览器。
<button onClick="amber.globals.Browser._openOn_(amber.globals.ProcessingClock)">ProcessingClock class
I get the error message amber not defined
(see screen shot below). 我收到
amber not defined
的错误消息amber not defined
(请参见下面的屏幕截图)。
Question How do I open the browser properly? 问题如何正确打开浏览器?
Of course it is not defined, amber
is just a local variable (that is, a parameter) of the loader callback function. 当然没有定义,
amber
只是加载程序回调函数的局部变量(即参数)。 Either remember it to some global and reuse in button onclick code (ugly), install onclick handler on the button directly inside loader callback, where you have access to amber
variable (probably clumsy, but the most clean), or use require('amber/helpers')
instead of amber
in direct onclick handlers (in your example you want need to use it twice). 请记住它的一些全局信息,然后在按钮onclick代码中重用(很丑陋),或者在加载器回调内部直接在按钮上安装onclick处理程序,您可以在其中访问
amber
变量(可能笨拙,但最干净),或者使用require('amber/helpers')
而不是直接在onclick处理程序中显示为amber
(在您的示例中,您需要使用两次)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.