mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-28 21:05:43 +08:00
docs(guide/module) fixed global controller in example
Global controllers have been disallowed in Angular 1.3 Closes #8248
This commit is contained in:
committed by
Peter Bacon Darwin
parent
3ba98186b8
commit
222edd8031
@@ -99,7 +99,7 @@ The above is a suggestion. Tailor it to your needs.
|
|||||||
angular.module('xmpl.directive', []);
|
angular.module('xmpl.directive', []);
|
||||||
|
|
||||||
angular.module('xmpl.filter', []);
|
angular.module('xmpl.filter', []);
|
||||||
|
|
||||||
angular.module('xmpl', ['xmpl.service', 'xmpl.directive', 'xmpl.filter']).
|
angular.module('xmpl', ['xmpl.service', 'xmpl.directive', 'xmpl.filter']).
|
||||||
run(function(greeter, user) {
|
run(function(greeter, user) {
|
||||||
// This is effectively part of the main method initialization code
|
// This is effectively part of the main method initialization code
|
||||||
@@ -107,13 +107,11 @@ The above is a suggestion. Tailor it to your needs.
|
|||||||
salutation: 'Bonjour'
|
salutation: 'Bonjour'
|
||||||
});
|
});
|
||||||
user.load('World');
|
user.load('World');
|
||||||
|
}).
|
||||||
|
controller('XmplController', function($scope, greeter, user){
|
||||||
|
$scope.greeting = greeter.greet(user.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// A Controller for your app
|
|
||||||
var XmplController = function($scope, greeter, user) {
|
|
||||||
$scope.greeting = greeter.greet(user.name);
|
|
||||||
};
|
|
||||||
</file>
|
</file>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user