docs(ngSwitch): update example to use a module

This commit is contained in:
Brian Ford
2014-07-07 23:33:23 -07:00
parent 7f6322df6a
commit 2788cc4e12

View File

@@ -55,9 +55,9 @@
*
*
* @example
<example module="ngAnimate" deps="angular-animate.js" animations="true">
<example module="switchExample" deps="angular-animate.js" animations="true">
<file name="index.html">
<div ng-controller="Ctrl">
<div ng-controller="ExampleController">
<select ng-model="selection" ng-options="item for item in items">
</select>
<tt>selection={{selection}}</tt>
@@ -71,10 +71,11 @@
</div>
</file>
<file name="script.js">
function Ctrl($scope) {
$scope.items = ['settings', 'home', 'other'];
$scope.selection = $scope.items[0];
}
angular.module('switchExample', ['ngAnimate'])
.controller('ExampleController', ['$scope', function($scope) {
$scope.items = ['settings', 'home', 'other'];
$scope.selection = $scope.items[0];
}]);
</file>
<file name="animations.css">
.animate-switch-container {