Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2788cc4

Browse files
committed
docs(ngSwitch): update example to use a module
1 parent 7f6322d commit 2788cc4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/ng/directive/ngSwitch.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
*
5656
*
5757
* @example
58-
<example module="ngAnimate" deps="angular-animate.js" animations="true">
58+
<example module="switchExample" deps="angular-animate.js" animations="true">
5959
<file name="index.html">
60-
<div ng-controller="Ctrl">
60+
<div ng-controller="ExampleController">
6161
<select ng-model="selection" ng-options="item for item in items">
6262
</select>
6363
<tt>selection={{selection}}</tt>
@@ -71,10 +71,11 @@
7171
</div>
7272
</file>
7373
<file name="script.js">
74-
function Ctrl($scope) {
75-
$scope.items = ['settings', 'home', 'other'];
76-
$scope.selection = $scope.items[0];
77-
}
74+
angular.module('switchExample', ['ngAnimate'])
75+
.controller('ExampleController', ['$scope', function($scope) {
76+
$scope.items = ['settings', 'home', 'other'];
77+
$scope.selection = $scope.items[0];
78+
}]);
7879
</file>
7980
<file name="animations.css">
8081
.animate-switch-container {

0 commit comments

Comments
 (0)