I developed a web portal where users can log in, manage their account stuff, and so on. Technically, it's a JSP/Servlet application running on Tomcat, delivering pages as templates. Each site has an angular app with Controllers, etc. and loads data from JSON-Service (Spring MVC). It's not the classical "single page app" but a "single page per service" app (each page has it's own angular app with sub-views, directives, etc.)
That all works great, but from time to time I'm facing with a strange error, where javascript-execution seems to stop completely (see screenshot http://i.stack.imgur.com/EF28q.png ). The green ajax-loader should be hidden by angular expression, you see the curly braces in breadcumb navigation and content, success and error-messages appear both, but should be hidden.
After some hours of debugging I found out:
I followed the angular guidelines for Internet Explorer, so I prefixed all directives with data-*, etc. and I followed the "Note on minification" ( http://docs.angularjs.org/tutorial/step_05 ), so my angular controller/services/directives follow the bracket notation: app.controller('Ctrl', ['$scope', '...', function($scope, ...){}]);
Any help would be greatly appreciated
Florian
you can try this:
App.controller('Ctrl', ['$scope', '$http', ...... ,
function ($scope, $http, ......) {
}]);
you need to use this way to avoid $scope , $http, ... parameters be compressed
Seems like the angular execution has not even started. Because of the sporadic nature of the error, I would consider some timing problem with the DOM. Do you use RequireJS for async script loading?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.