title: Loading Amber layout: default permalink: "loading-amber.html"
In this section we will learn how setup an index.html
page to load
amber using requirejs.
Amber packages are AMD modules. AMD (Asynchronous Module Definition) is a JavaScript API for defining modules and dependencies to be loaded asynchronously.
Amber ships with requirejs, the most popular AMD loader implementation.
Create an index.html
file with the following contents:
{% highlight html %} <!DOCTYPE html>
<head>
<script
type='text/javascript'
src='bower_components/amber/support/requirejs/require.min.js'>
</script>
<script
type='text/javascript'
src='bower_components/amber/support/amber.js'>
</script>
</head>
<body>
</body>
{% endhighlight %}
In the next script we define how Amber packages are loaded. Amber
comes with several AMD modules to load Amber; the default one --
the one with support for application development and in-browser IDE --
being amber/devel
.
{% highlight html %} <!DOCTYPE html>
<head>
<script
type='text/javascript'
src='bower_components/amber/support/requirejs/require.min.js'>
</script>
<script
type='text/javascript'
src='bower_components/amber/support/amber.js'>
</script>
<script type='text/javascript'>
require(['amber/devel'], function (amber) {
amber.initialize();
});
</script>
</head>
<body>
</body>
{% endhighlight %}
This page is unfinished.