File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 54
54
*
55
55
* This example demonstrates the `controller as` syntax.
56
56
*
57
- * <example name="ngControllerAs">
57
+ * <example name="ngControllerAs" module="controllerAsExample" >
58
58
* <file name="index.html">
59
59
* <div id="ctrl-as-exmpl" ng-controller="SettingsController1 as settings">
60
60
* Name: <input type="text" ng-model="settings.name"/>
75
75
* </div>
76
76
* </file>
77
77
* <file name="app.js">
78
+ * angular.module('controllerAsExample', [])
79
+ * .controller('SettingsController1', SettingsController1);
80
+ *
78
81
* function SettingsController1() {
79
82
* this.name = "John Smith";
80
83
* this.contacts = [
134
137
*
135
138
* This example demonstrates the "attach to `$scope`" style of controller.
136
139
*
137
- * <example name="ngController">
140
+ * <example name="ngController" module="controllerExample" >
138
141
* <file name="index.html">
139
142
* <div id="ctrl-exmpl" ng-controller="SettingsController2">
140
143
* Name: <input type="text" ng-model="name"/>
155
158
* </div>
156
159
* </file>
157
160
* <file name="app.js">
161
+ * angular.module('controllerExample', [])
162
+ * .controller('SettingsController2', ['$scope', SettingsController2]);
163
+ *
158
164
* function SettingsController2($scope) {
159
165
* $scope.name = "John Smith";
160
166
* $scope.contacts = [
You can’t perform that action at this time.
0 commit comments