docs(ngInclude): update example to use a module

This commit is contained in:
Brian Ford
2014-07-07 23:19:52 -07:00
parent d35f50ee11
commit d28a0bf49e

View File

@@ -43,9 +43,9 @@
* - Otherwise enable scrolling only if the expression evaluates to truthy value.
*
* @example
<example module="ngAnimate" deps="angular-animate.js" animations="true">
<example module="includeExample" deps="angular-animate.js" animations="true">
<file name="index.html">
<div ng-controller="Ctrl">
<div ng-controller="ExampleController">
<select ng-model="template" ng-options="t.name for t in templates">
<option value="">(blank)</option>
</select>
@@ -57,12 +57,13 @@
</div>
</file>
<file name="script.js">
function Ctrl($scope) {
$scope.templates =
[ { name: 'template1.html', url: 'template1.html'},
{ name: 'template2.html', url: 'template2.html'} ];
$scope.template = $scope.templates[0];
}
angular.module('includeExample', ['ngAnimate'])
.controller('ExampleController', ['$scope', function($scope) {
$scope.templates =
[ { name: 'template1.html', url: 'template1.html'},
{ name: 'template2.html', url: 'template2.html'} ];
$scope.template = $scope.templates[0];
}]);
</file>
<file name="template1.html">
Content of template1.html