Skip to content

Commit a95bfbe

Browse files
thewarpaintpetebacondarwin
authored andcommitted
docs(guide): format snippets of code in plain text
1 parent c6fa3b0 commit a95bfbe

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ constructor). Constructors are always applied to an existing scope object.
2121

2222
You set up the initial state of a scope by creating model properties. For example:
2323

24-
function GreetingCtrl($scope) {
25-
$scope.greeting = 'Hola!';
26-
}
24+
<pre>
25+
function GreetingCtrl($scope) {
26+
$scope.greeting = 'Hola!';
27+
}
28+
</pre>
2729

2830
The `GreetingCtrl` controller creates a `greeting` model which can be referred to in a template.
2931

@@ -32,11 +34,13 @@ in the global scope. This is only for demonstration purposes - in a real
3234
application you should use the `.controller` method of your Angular module for
3335
your application as follows:
3436

35-
var myApp = angular.module('myApp',[]);
37+
<pre>
38+
var myApp = angular.module('myApp',[]);
3639

37-
myApp.controller('GreetingCtrl', ['$scope', function($scope) {
38-
$scope.greeting = 'Hola!';
39-
}]);
40+
myApp.controller('GreetingCtrl', ['$scope', function($scope) {
41+
$scope.greeting = 'Hola!';
42+
}]);
43+
</pre>
4044

4145
Note also that we use the array notation to explicitly specify the dependency
4246
of the controller on the `$scope` service provided by Angular.

0 commit comments

Comments
 (0)