Upgrade to angularjs 1.2.0 rc1
This commit is contained in:
parent
d223dfd662
commit
d6b021bfaf
674 changed files with 79667 additions and 62269 deletions
47
lib/angular/docs/partials/api/ng.$templateCache.html
Normal file → Executable file
47
lib/angular/docs/partials/api/ng.$templateCache.html
Normal file → Executable file
|
@ -1,9 +1,40 @@
|
|||
<h1><code ng:non-bindable="">$templateCache</code>
|
||||
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
|
||||
)</span>
|
||||
</h1>
|
||||
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/cacheFactory.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
|
||||
<div class="description"><p>Cache used for storing html templates.</p>
|
||||
|
||||
<p>See <a href="api/ng.$cacheFactory"><code>$cacheFactory</code></a>.</p></div>
|
||||
<a href="http://github.com/angular/angular.js/tree/v1.2.0rc1/src/ng/cacheFactory.js#L192" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a><a href="http://github.com/angular/angular.js/edit/master/src/ng/cacheFactory.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">$templateCache</code>
|
||||
<div><span class="hint">service in module <code ng:non-bindable="">ng</code>
|
||||
</span>
|
||||
</div>
|
||||
</h1>
|
||||
<div><h2 id="Description">Description</h2>
|
||||
<div class="description"><div class="ng-templatecache-page"><p>The first time a template is used, it is loaded in the template cache for quick retrieval. You can
|
||||
load templates directly into the cache in a <code>script</code> tag, or by consuming the <code>$templateCache</code>
|
||||
service directly.</p>
|
||||
<p>Adding via the <code>script</code> tag:
|
||||
<pre class="prettyprint linenums">
|
||||
<html ng-app>
|
||||
<head>
|
||||
<script type="text/ng-template" id="templateId.html">
|
||||
This is the content of the template
|
||||
</script>
|
||||
</head>
|
||||
...
|
||||
</html>
|
||||
</pre>
|
||||
<p><strong>Note:</strong> the <code>script</code> tag containing the template does not need to be included in the <code>head</code> of the document, but
|
||||
it must be below the <code>ng-app</code> definition.</p>
|
||||
<p>Adding via the $templateCache service:</p>
|
||||
<pre class="prettyprint linenums">
|
||||
var myApp = angular.module('myApp', []);
|
||||
myApp.run(function($templateCache) {
|
||||
$templateCache.put('templateId.html', 'This is the content of the template');
|
||||
});
|
||||
</pre>
|
||||
<p>To retrieve the template later, simply use it in your HTML:
|
||||
<pre class="prettyprint linenums">
|
||||
<div ng-include=" 'templateId.html' "></div>
|
||||
</pre>
|
||||
<p>or get it via Javascript:
|
||||
<pre class="prettyprint linenums">
|
||||
$templateCache.get('templateId.html')
|
||||
</pre>
|
||||
<p>See <a href="api/ng.$cacheFactory"><code>$cacheFactory</code></a>.</p>
|
||||
</div></div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue