aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/tutorial/step_02.ngdoc
diff options
context:
space:
mode:
authorJames Dunn2013-10-03 10:16:44 +0100
committerPete Bacon Darwin2013-10-03 10:19:19 +0100
commit575f63ac508a988e0c0ecbf93f62ea6f4bab13c0 (patch)
treebd3fdf07e1b4d0e98a926b9f3ba25f3d4ab81bcd /docs/content/tutorial/step_02.ngdoc
parentd3fcacedd6e6fe14892fa110ebe20babd886d4bb (diff)
downloadangular.js-575f63ac508a988e0c0ecbf93f62ea6f4bab13c0.tar.bz2
docs(tutorial): update examples to show best practices
Closes #4256, #4255, #4254, #4253, #4250, #4092
Diffstat (limited to 'docs/content/tutorial/step_02.ngdoc')
-rw-r--r--docs/content/tutorial/step_02.ngdoc8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/content/tutorial/step_02.ngdoc b/docs/content/tutorial/step_02.ngdoc
index e21e18df..f9f9b2d8 100644
--- a/docs/content/tutorial/step_02.ngdoc
+++ b/docs/content/tutorial/step_02.ngdoc
@@ -74,7 +74,10 @@ the `PhoneListCtrl` __controller__:
__`app/js/controllers.js`:__
<pre>
-function PhoneListCtrl($scope) {
+
+var myApp = angular.module('myApp',[]);
+
+myApp.controller('PhoneListCtrl', ['$scope', function($scope) {
$scope.phones = [
{"name": "Nexus S",
"snippet": "Fast just got faster with Nexus S."},
@@ -83,7 +86,8 @@ function PhoneListCtrl($scope) {
{"name": "MOTOROLA XOOMâ„¢",
"snippet": "The Next, Next Generation tablet."}
];
-}
+}]);
+
</pre>