mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-11 22:36:57 +08:00
docs(ngInclude): update example to use a module
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user