Update loadOnDemand.js

Adapter to better fit Angular 1.2.0.rcx.