Problem when posting site in iis made in angularjs

0

I am trying to publish a site in angularjs in iis but after publishing, when I go to it, it returns me in the console the following error:

Indevelopmentthiserrordoesnotoccur...

Mystructurelookslikethis

Myconfiglookslikethis:

<?xmlversion="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <defaultDocument>
        <files>
            <clear />
            <add value="index.html" />
        </files>
    </defaultDocument>
  </system.webServer>
</configuration>
    
asked by anonymous 12.04.2018 / 16:19

1 answer

1

This may occur at the time of code minification, when your dependency injections in the controllers are not in the "Strict-di" form.

Make sure your controllers and services are all following the same pattern, which would be:

The correct one:

.controller('NomeController', ["$scope", "$rootScope", function($scope, $rootScope) {

}]);

Instead of:

.controller('NomeController', function($scope, $rootScope, etc...) {

});

To check that all controllers are annotated correctly, without having to minify or test in production, insert the "ng-strict-di" attribute in the ng-app element, or bootstrap the script, add the parameter referring to this at app initialization.

For example:

<div ng-app="myApp" ng-strict-di>
    
12.04.2018 / 18:15