Skip to content

Commit bb00569

Browse files
chancedjamesdaily
authored andcommitted
docs(tutorial/step-4): controllers are no longer global functions
The docs did not line up with the codebase / previous steps of the tutorial. Closes angular#4988
1 parent 9bf8b8e commit bb00569

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/content/tutorial/step_04.ngdoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ describe('PhoneCat controllers', function() {
112112
describe('PhoneListCtrl', function(){
113113
var scope, ctrl;
114114

115-
beforeEach(function() {
116-
scope = {},
117-
ctrl = new PhoneListCtrl(scope);
118-
});
119-
115+
beforeEach(module('phonecatApp'));
116+
117+
beforeEach(inject(function($controller) {
118+
scope = {};
119+
ctrl = $controller('PhoneListCtrl', {$scope:scope});
120+
}));
120121

121122
it('should create "phones" model with 3 phones', function() {
122123
expect(scope.phones.length).toBe(3);

0 commit comments

Comments
 (0)