I am defining a new controller like this:
$controller(function ($scope) {}, {})
But when i turn on strict mode, this throws me an error saying $scope have to be declared as an annotation.
The problem is, is that the $controller service accepts only a function method or a controller name, and not an array where i can define my annotations.
https://docs.angularjs.org/api/ngMock/service/$controller
Does anyone have an idea how i can get around this? The reason that it has to work in strict mode, is because all my code gets minified, so if it doesnt work in strict mode, it doesnt work either when its minified.
Thank you in advance,
Mathias
You can name your function and use $inject.
$controller(myController, {});
myController.$inject = ['$scope'];
function myController($scope) {}