javascript - InvalidStateError with AngularJS v1.3.20 in Internet Explorer 11 -
i have created web application angularjs , php back-end. encountered strange error occurs in internet explorer. chrome has no problems. invalidstateerror on <main>
html element of application. when error occurs, app crashes. can't reproduce when open application on 1 device. when open application on multiple devices, error occurs occasionally. application contains login where, testing, user logs in same username. have tried use random username login, users won't login same username. did not resolve problem. have no idea problem is. maybe request fails, maybe server configuration, maybe file can't loaded. have no idea triggers error. can guys give directions search kind of error?
see error below:
invalidstateerror <main class="ng-scope" ng-if="!app.ismobile" data-ui-view="main"> { [functions]: , __proto__: { [functions]: , __proto__: { }, abort_err: 20, code: <permission denied>, constructor: { }, data_clone_err: 25, domstring_size_err: 2, hierarchy_request_err: 3, index_size_err: 1, inuse_attribute_err: 10, invalid_access_err: 15, invalid_character_err: 5, invalid_modification_err: 13, invalid_node_type_err: 24, invalid_state_err: 11, message: <permission denied>, name: <permission denied>, namespace_err: 14, network_err: 19, no_data_allowed_err: 6, no_modification_allowed_err: 7, not_found_err: 8, not_supported_err: 9, parse_err: 81, quota_exceeded_err: 22, security_err: 18, serialize_err: 82, syntax_err: 12, timeout_err: 23, type_mismatch_err: 17, url_mismatch_err: 21, validation_err: 16, wrong_document_err: 4 }, abort_err: 20, code: 11, constructor: { }, data_clone_err: 25, domstring_size_err: 2, hierarchy_request_err: 3, index_size_err: 1, inuse_attribute_err: 10, invalid_access_err: 15, invalid_character_err: 5, invalid_modification_err: 13, invalid_node_type_err: 24, invalid_state_err: 11, message: "invalidstateerror", name: "invalidstateerror", namespace_err: 14, network_err: 19, no_data_allowed_err: 6, no_modification_allowed_err: 7, not_found_err: 8, not_supported_err: 9, parse_err: 81, quota_exceeded_err: 22, security_err: 18, serialize_err: 82, syntax_err: 12, timeout_err: 23, type_mismatch_err: 17, url_mismatch_err: 21, validation_err: 16, wrong_document_err: 4 } "<main class="ng-scope" ng-if="!app.ismobile" data-ui-view="main">"
and here class set ui view:
(function(){ 'use strict'; /* @mindpreloads */ var image_structure = ['spritesheets/sheet_faq.png','spritesheets/sheet_global.png','spritesheets/sheet_globe.png','spritesheets/sheet_mission_select.png','spritesheets/sheet_mockups.jpg','spritesheets/sheet_progress.png','spritesheets/sheet_quiz.png','spritesheets/sheet_start_screen.png']; angular .module('app') .config(routes) .run(routing); routes.$inject = ['$stateprovider', '$urlrouterprovider']; function routes($stateprovider, $urlrouterprovider) { var defaultroute = '/error/notfound'; $urlrouterprovider .when('', '/login') .when('/', '/login') .otherwise(defaultroute); $stateprovider .state('app', { 'abstract': true, resolve: { authstatus: [ 'authservice', function(authservice) { return authservice.authorise(); } ], preload: [ 'preloader', function(preloader) { return preloader.loadimages(image_structure, 'sheet_faq', 'sheet_global', 'sheet_globe', 'sheet_mission_select', 'sheet_mockups', 'sheet_progress', 'sheet_start_screen'); } ] } }) .state('notfound', createroute('/error/notfound', '/error/notfound.html')) .state('denied', createroute('/error/denied', '/error/denied.html')) // authenticated routes .state('login' , createroute('/login' , '/login/login.html', 'login' , 'app' , null)) .state('logout', createroute('/logout', '' , 'logoutcontroller', 'app', ['basic'])) .state('home' , createroute('/home' , '/home/home.html' , 'home' , 'app', ['basic'], homeres.resolve)) .state('quiz' , createroute('/quiz' , '/quiz/quiz.html' , 'quiz' , 'app', ['basic'], { preloadquiz: ['preloader', 'communication', function(preloader, communication) { return preloader.loadimages(image_structure, 'sheet_quiz') }]})) .state('debug' , createroute('/debug' , '/debug/debug.html', 'quiz' , 'app', ['basic'])) ; } routing.$inject = ['$rootscope', 'homeservice', 'debugservice', 'debuglistservice', 'quizservice', '$location', 'preloader']; /* @nginject */ function routing($rootscope, homes, debugs, debuglists, quizs, $location, preloader) { $rootscope.$on('$statechangestart', function(event, tostate) { if(tostate.name === "debug") { quizs.setmaxquestionnumber(5); in_debug_quiz = true; debugs.setpages(debuglists.getdebuglist()); quizs.reset(); $location.path('/debug'); } }); $rootscope.$on('$routechangestart', preloader.setresolvestate(true, true)); $rootscope.$on('$routechangesuccess', preloader.setresolvestate(false, true)); $rootscope.$on('$routechangeerror', preloader.setresolvestate(false, true)); $rootscope.$on('$statechangestart', preloader.setresolvestate(true, false)); $rootscope.$on('$statechangesuccess', preloader.setresolvestate(false, true)); $rootscope.$on('$statechangeerror', preloader.setresolvestate(false, true)); } /** * creates new route * @todo move code provider modules can use it. * * @param {string} url url route should listen * @param {string} template path template display (without 'app') in main view * @param {string} controller controller use (as 'vm') * @param {string} parent parent route * @param {array} permissions permissions required * @param {object} resolve items resolve * @return {object} route object */ function createroute(url, template, controller, parent, permissions, resolve) { var route = {data: {permissions: []}}; if (template) { route.views = {'main@': {templateurl: 'app' + template}}; if (controller) { route.views['main@'].controller = controller; route.views['main@'].controlleras = 'vm'; } } if (parent) { route.parent = parent; } if (url) { route.url = url; } if (permissions) { route.data.permissions = permissions; } if (resolve) { route.resolve = resolve; } return route; } })();
the html5 main tag not supported internet explorer 11(see http://caniuse.com/#search=main). make work, think need solution: https://stackoverflow.com/a/35820454/3237604.
Comments
Post a Comment