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

Skip to content

Commit 4349de3

Browse files
committed
docs(ngController): update examples to use modules
1 parent df545d7 commit 4349de3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ng/directive/ngController.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
*
5555
* This example demonstrates the `controller as` syntax.
5656
*
57-
* <example name="ngControllerAs">
57+
* <example name="ngControllerAs" module="controllerAsExample">
5858
* <file name="index.html">
5959
* <div id="ctrl-as-exmpl" ng-controller="SettingsController1 as settings">
6060
* Name: <input type="text" ng-model="settings.name"/>
@@ -75,6 +75,9 @@
7575
* </div>
7676
* </file>
7777
* <file name="app.js">
78+
* angular.module('controllerAsExample', [])
79+
* .controller('SettingsController1', SettingsController1);
80+
*
7881
* function SettingsController1() {
7982
* this.name = "John Smith";
8083
* this.contacts = [
@@ -134,7 +137,7 @@
134137
*
135138
* This example demonstrates the "attach to `$scope`" style of controller.
136139
*
137-
* <example name="ngController">
140+
* <example name="ngController" module="controllerExample">
138141
* <file name="index.html">
139142
* <div id="ctrl-exmpl" ng-controller="SettingsController2">
140143
* Name: <input type="text" ng-model="name"/>
@@ -155,6 +158,9 @@
155158
* </div>
156159
* </file>
157160
* <file name="app.js">
161+
* angular.module('controllerExample', [])
162+
* .controller('SettingsController2', ['$scope', SettingsController2]);
163+
*
158164
* function SettingsController2($scope) {
159165
* $scope.name = "John Smith";
160166
* $scope.contacts = [

0 commit comments

Comments
 (0)