How to check for the existence of a module without an error being raised?
I am not aware of a way of checking without an error being raised; however, notice that the issue is that it was an Uncaught Error, not that an error was thrown. The pattern for catching such an error is the following. try { angular.module(“ngRoute”) } catch(err) { /* failed to require */ } If …