title | layout | permalink | parent |
---|---|---|---|
FAQ |
default |
faq.html |
Overview |
You can see the steps described here which are basically:
npm install -g amber-cli
mkdir newProjectDir
cd newProjectDir
amber init
amber serve
And visit http://localhost:4000
Here is also a terminal screencast doing just that:
<iframe src="http://showterm.io/457dc8b24df38d67e421d#fast" width="640" height="480"></iframe>Press this sequence of keys: Shift, Shift, Ctrl, Shift. A dialog should appear with "Legacy IDE" and "Helios IDE" buttons.
In case the above did not work, evaluate the following in the JavaScript console:
require('amber/helpers').popupHelios()
- Open IDE at http://amber-lang.net/.
- Go to the Workspace tab.
- Print or inspect the expression
Smalltalk version
.
For the latest stable, go for
npm -g install amber-cli
If you want the latest prerelease, go for
npm -g install amber-cli@bleedingedge
Note that bleedingedge will not install the stable version even if it is newer.
If you want to be sure which version is latest and which one is bleedingedge use:
npm info amber-cli
and you will find them in the dist-tags
section.
-
npm install -g amber-cli
will get it fixed for all new projects and -
npm update
in every project dir will fix it for current projects -
bower install
in every project dir will fix it for current projects
^0.14.1
is a shortcut for >=0.14.1 <0.15.0
.
Contrary to a common misconception, package.json / bower.json do not show the version that is installed, but instead they describe what interval of versions is required for installation itself. Ref: node-semver caret ranges.
If you have <input id="field1" ...
, the way to get its value is '#field1' asJQuery val
.
To allow you to use JavaScript from your Amber code, Amber uses a proxy that will route Smalltalk messages as JavaScript calls as transparent as possible. For example, all JavaScript methods in jQuery are available to you this way:
Without arguments:
'#element-id' asJQuery hide
'#element-id' asJQuery show
With one argument:
'#element-id' asJQuery attr: 'data' put: 'some-value'
With many arguments:
aQuery.sampleFunc(a,b,c);
translates to aQuery sampleFunc: a andThis: b andThat: c.
In the previous examples, the put:
and the andThis:andThat:
part of the Smalltalk selector can be named any way you want. For JavaScript functions the names in that part of the keyword are ignored. Amber needs only the first part of the selector matching the JavaScript function name.