From a95bfbeac084a1aad9e296d24e0c78c353368235 Mon Sep 17 00:00:00 2001 From: Eduardo Garcia Date: Tue, 21 May 2013 16:40:48 -0500 Subject: docs(guide): format snippets of code in plain text --- .../guide/dev_guide.mvc.understanding_controller.ngdoc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'docs/content/guide') diff --git a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc index 47d59427..e3a570d4 100644 --- a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc +++ b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc @@ -21,9 +21,11 @@ constructor). Constructors are always applied to an existing scope object. You set up the initial state of a scope by creating model properties. For example: -function GreetingCtrl($scope) { - $scope.greeting = 'Hola!'; -} +
+ function GreetingCtrl($scope) {
+ $scope.greeting = 'Hola!';
+ }
+
The `GreetingCtrl` controller creates a `greeting` model which can be referred to in a template.
@@ -32,11 +34,13 @@ in the global scope. This is only for demonstration purposes - in a real
application you should use the `.controller` method of your Angular module for
your application as follows:
-var myApp = angular.module('myApp',[]);
+
+ var myApp = angular.module('myApp',[]);
-myApp.controller('GreetingCtrl', ['$scope', function($scope) {
- $scope.greeting = 'Hola!';
-}]);
+ myApp.controller('GreetingCtrl', ['$scope', function($scope) {
+ $scope.greeting = 'Hola!';
+ }]);
+
Note also that we use the array notation to explicitly specify the dependency
of the controller on the `$scope` service provided by Angular.
--
cgit v1.2.3