//index.html
<html ng-app="app">
//app.js
angular.module('app', 'test-module')
If I happen to forget to register the test-module in any of my scripts like this:
angular.module('test-module', [])
This can lead to errors appearing in the browser and result in the entire website failing to load:
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module test-module due to:
Error: [$injector:nomod] Module 'test-module' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
Q: How can I make sure that the website page will still load even if there are errors related to unknown modules being loaded?