docs(tutorial): fix style across tutorial steps

This commit is contained in:
Brian Ford
2013-10-08 10:45:00 -07:00
parent d769b8b8f0
commit 556e8eece6
5 changed files with 59 additions and 54 deletions

View File

@@ -54,16 +54,15 @@ components themselves, but by the DI subsystem).
__`app/js/controllers.js:`__
<pre>
function PhoneListCtrl($scope, $http) {
var phonecatApp = angular.module('phonecatApp', []);
phonecatApp.controller('PhoneListCtrl', function PhoneListCtrl($scope) {
$http.get('phones/phones.json').success(function(data) {
$scope.phones = data;
});
$scope.orderProp = 'age';
}
var phonecatApp = angular.module('phonecatApp',[]);
phonecatApp.controller('PhoneListCtrl', PhoneListCtrl);
});
</pre>
`$http` makes an HTTP GET request to our web server, asking for `phone/phones.json` (the url is
@@ -107,7 +106,7 @@ constructor function, if you were to {@link http://en.wikipedia.org/wiki/Minific
minify} the JavaScript code for `PhoneListCtrl` controller, all of its function arguments would be
minified as well, and the dependency injector would not be able to identify services correctly.
There are two ways to overcome issues caused by minification.
There are two ways to overcome issues caused by minification:
* You can create a `$inject` property on the controller function which holds an array of strings.
Each string in the array is the name of the service to inject for the corresponding parameter.