{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/13931","repository_url":"https://api.github.com/repos/angular/angular.js","labels_url":"https://api.github.com/repos/angular/angular.js/issues/13931/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/13931/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/13931/events","html_url":"https://github.com/angular/angular.js/issues/13931","id":130825411,"number":13931,"title":"Feature: Better error handling for ngRoute","user":{"login":"baym0n","id":7535912,"avatar_url":"https://avatars.githubusercontent.com/u/7535912?v=3","gravatar_id":"","url":"https://api.github.com/users/baym0n","html_url":"https://github.com/baym0n","followers_url":"https://api.github.com/users/baym0n/followers","following_url":"https://api.github.com/users/baym0n/following{/other_user}","gists_url":"https://api.github.com/users/baym0n/gists{/gist_id}","starred_url":"https://api.github.com/users/baym0n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baym0n/subscriptions","organizations_url":"https://api.github.com/users/baym0n/orgs","repos_url":"https://api.github.com/users/baym0n/repos","events_url":"https://api.github.com/users/baym0n/events{/privacy}","received_events_url":"https://api.github.com/users/baym0n/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/component:%20ngRoute","name":"component: ngRoute","color":"DDDDDD"},{"url":"https://api.github.com/repos/angular/angular.js/labels/frequency:%20low","name":"frequency: low","color":"bfe5bf"},{"url":"https://api.github.com/repos/angular/angular.js/labels/severity:%20inconvenient","name":"severity: inconvenient","color":"006b75"},{"url":"https://api.github.com/repos/angular/angular.js/labels/type:%20feature","name":"type: feature","color":"00a606"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/27","html_url":"https://github.com/angular/angular.js/milestones/Backlog","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/27/labels","id":489171,"number":27,"title":"Backlog","description":"Holds the backlog of issues and pull requests that have been triaged.\r\n\r\nBefore assigning items to this milestone they should be labelled, at the very least with the correct \"type\" label (i.e. \"issue\", \"pr\", \"bug\", \"regression\", \"chore\", \"docs\", etc).  Preferably you should also check for duplicate issues/PRs, note CLA status and assign \"complexity\" and \"impact\" labels too.","creator":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"open_issues":605,"closed_issues":1122,"state":"open","created_at":"2013-11-18T23:30:35Z","updated_at":"2016-02-02T21:52:18Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-02-02T21:37:23Z","updated_at":"2016-02-03T11:07:52Z","closed_at":null,"body":"For a route definition, a comfy error handling would be nice.\r\n\r\n    .config(function($routeProvider) {\r\n        $routeProvider\r\n        .when('/', {\r\n            templateUrl: 'view/welcome.html'\r\n        })\r\n        .when('/page', {\r\n            templateUrl: 'view/page.html'\r\n        })\r\n        .otherwise({\r\n            templateUrl: 'view/404.html'\r\n        });\r\n    })\r\n\r\nIf one or more of the templates (referenced by url) could not be loaded from the server, a fallback strategy is required. For example something like this:\r\n\r\n    .config(function($routeProvider) {\r\n        $routeProvider\r\n        .when('/', {\r\n            templateUrl: 'view/welcome.html'\r\n        })\r\n        .when('/page', {\r\n            templateUrl: 'view/page.html'\r\n        })\r\n        .otherwise({\r\n            templateUrl: 'view/404.html'\r\n        })\r\n        .onError({\r\n            template: 'Template could not be loaded'\r\n        });\r\n    })\r\n\r\nThe onError \"route\" is automatically used, if there if a template could not be resolved.\r\n\r\nEDIT: [see also here](http://stackoverflow.com/questions/35162551/angularjs-fallback-strategy-when-template-not-found), there is actually no working way I could find to do that."},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/179169530","html_url":"https://github.com/angular/angular.js/issues/13931#issuecomment-179169530","issue_url":"https://api.github.com/repos/angular/angular.js/issues/13931","id":179169530,"user":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T11:07:52Z","updated_at":"2016-02-03T11:07:52Z","body":"Under which circumstances do you expect your route templates not to be found? Are you loading arbitrary templates? Not-found should basically not happen if you put your templates in the templateCache in a build step.\r\nUnfound templates also trigger a $routeChangeError which you can listen to. It's not the most convenient way (and you'll have an error in your console), but it's possible to do something about this."}}