R
R
rejjer2016-09-15 15:39:07
Angular
rejjer, 2016-09-15 15:39:07

What's the difference in controller declaration syntax?

.controller('ControllerName', ['$scope', '$rootScope', '$location',
  function ($scope, $rootScope, $location) {
    ...
}])

or like this:
.controller('ControllerName', function ($scope, $rootScope, $location) {
  ...
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2016-09-15
@rejjer

When minifying the code, the second option will break

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question