0

When I add use strict on the following code I get this error, why?

L1:C1] W097: Use the function form of "use strict". 'use strict'; [L3:C1] W117: 'angular' is not defined. angular.module('app.login', [ [L30:C9] W117: 'console' is not defined. console.log(resources); [L34:C13] W117: 'console' is not defined. console.log("clicked!");

Warning: Task "jshint:src" failed. Use --force to continue.

'use strict';

angular.module('app.login', [
        'ui.router',
    ])

    .config(function config($stateProvider) {
        $stateProvider.state('login', {
            url: '/login',
            views: {
                "main": {
                    controller: 'LoginCtrl',
                    templateUrl: 'login/login.tpl.html'
                }
            },
            data: {}
        });
    })

    .controller('LoginCtrl', ['$scope','resources', function ($scope, resources) {

        $scope.user = {
            email: '',
            password: ''
        };      

    }]);

If I understand correctly it wants me to use a wrapper i.e. (function() { but I don't understand why this would be required!

Prometheus
  • 32,405
  • 54
  • 166
  • 302

0 Answers0