Podcast/lib/angular/docs/partials/error/$injector:nomod.html
2013-08-21 19:46:51 +02:00

21 lines
1.7 KiB
HTML
Executable file

<a href="http://github.com/angular/angular.js/edit/master/docs/content/error/injector/nomod.ngdoc" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">Module Unavailable</code>
<div><span class="hint">error in component <code ng:non-bindable="">$injector</code>
</span>
</div>
</h1>
<div><pre class="minerr-errmsg" error-display="Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.">Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.</pre>
<h2 id="Description">Description</h2>
<div class="description"><div class="-injector-page -injector-nomod-page"><p>This error occurs when trying to &quot;re-open&quot; a module that has not yet been defined.</p>
<p>To define a new module, call <a href="api/angular.module"><code>angular.module</code></a> with a name
and an array of dependent modules, like so:</p>
<pre><code>// When defining a module with no module dependencies,
// the requires array should be defined and empty.
var myApp = angular.module(&#39;myApp&#39;, []);</code></pre>
<p>To retrieve a reference to the same module for further configuration, call
<code>angular.module</code> without the <code>requires</code> array.</p>
<pre><code>var myApp = angular.module(&#39;myApp&#39;);</code></pre>
<p>Calling <code>angular.module</code> without the <code>requires</code> array when the module has not yet
been defined causes this error to be thrown. To fix it, define your module with
a name and an empty array, as in the first example above.</p>
</div></div>
</div>