Skip to content

Require'ing modules in amber recipe

Manfred Kröhnert edited this page Oct 23, 2013 · 1 revision

Take the following JavaScript snippet:

<script type="text/javascript">
    require('amber/helpers').popupHelios()
</script>

It would get transformed into Amber Smalltalk the following way:

(require value: 'amber/helpers') popupHelios

Note: Another possibility is (window require: 'amber/helpers') popupHelios but using window is seen as worse style, the former is generic use of global require.

Clone this wiki locally