From ac56d1c9d90e0fc3996198a386f7599deeae65c6 Mon Sep 17 00:00:00 2001 From: Chance Date: Sat, 16 Nov 2013 22:56:23 -0500 Subject: 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 #4988 --- docs/content/tutorial/step_04.ngdoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'docs/content/tutorial') diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index df1b23ec..c2edf573 100644 --- a/docs/content/tutorial/step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -112,11 +112,12 @@ describe('PhoneCat controllers', function() { describe('PhoneListCtrl', function(){ var scope, ctrl; - beforeEach(function() { - scope = {}, - ctrl = new PhoneListCtrl(scope); - }); - + beforeEach(module('phonecatApp')); + + beforeEach(inject(function($controller) { + scope = {}; + ctrl = $controller('PhoneListCtrl', {$scope:scope}); + })); it('should create "phones" model with 3 phones', function() { expect(scope.phones.length).toBe(3); -- cgit v1.2.3