Link to home
Start Free TrialLog in
Avatar of Howard Bash
Howard BashFlag for United States of America

asked on

AngularJS Controller Module Stuck

I was going through a tutorial on AngularJS.  During the tutorial I needed to make controller file which I paste below:
angularForms.controller('efController',
    function efController($scope, efService) {
        $scope.employee = efService.employee;
    });

Open in new window


Unfortunately,  when I initially created this module I left off the efController value and instead had written the following;
angularForms.controller('',
    function efController($scope, efService) {
        $scope.employee = efService.employee;
    });

Open in new window


Which understandably failed to run and broke at that line with the omitted efController value.  So,  I typed it in and attempted to run.  However, the project keeps failing on that same line ignoring the correction.  There is some caching or temp file(s) that are causing this I think, but I haven't any idea where.

Any advise on this would be great.

Thanks!
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

use jsfiddle.net or ctrl-f5 to reload the page
Avatar of Howard Bash

ASKER

I have tried ctrl-f5 and that hasn't fixed this.  Also, jsfiddle.net is a site for working on JavaScript and so I'm not sure how that ties in with the issue I posted here.  Please explain.
I believe you are not injecting the scope and efService.


angularForms.controller('efController', ['$scope', 'efService',
    function efController($scope, efService) {
        $scope.employee = efService.employee;
    }]);
Not clear why you would say that.   Can you provide more detail?
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial