cmelion/angular-yepnope — pull request #4 by bitbay (2012-12-02 18:08:37+00:00)
Title: Created service and factory for yepnope

Charles,

i found Your project very interesting - but with a major design flaw.
Relying on the routechangestart event for pre-loading was not the best choice, as it turned out finally.

My case was a menu controller lazy-loaded in a view that had an update function on routechangesuccess. That $digest You call on the yepnope finished callback evaluates parallel to the normal flow of routing - like that, the first time the controllers loaded did not register the success-event.

Long story short...i took Your project and modified it to use the $routeProviders resolve functionality.
Now there is a yepnopeFactory (with a corresponding Service) that returns a promise when all the scripts are loaded by yepnope. Like this, the routing does not happen until the promises are resolved (or rejected), and everything works as expected!

Hope You like my solution, and that You find it useful (although i see that this project is abandoned for months).

Cheers, and happy coding!

ps: i could not run Your tests...so not e2e nor unit tested.