T; dg
Set the second drop-down list in jsFiddle for "No wrapper - in <head>" and you won't need the angular.bootstrap line.
Fiddle
Description
When the Angular library loads, it scans the DOM, looking for an element with the ng-app directive. When he finds one, he will begin the boot process.
In this process, Angular will take the value of the ng-app attribute ( InventoryModule in your case) and try to find the Angular module with the same name. If it fails, it will throw: Uncaught Error: No module: <module name> .
In your violin, you set the "Code Packing" field to the "onLoad" field. This drop-down list tells jsFiddle when to initialize the JS code that you put in the JS frame. When it is set to "onLoad", the code will run in the onLoad window event.
On the other hand, the Angular boot process will be executed on $(document).ready() , and since the $().ready event is fired before the onLoad event, Angular will try to initialize the InventoryModule module before the module is even defined, and whatβs there, where the "No module" error will be "No module" .
angular.bootstrap() is a manual way to do the same thing that Angular already does a $().ready() handler in it .
source share