The controller/directive pairs used for game modules alongside $.show() and hide() are attempting to do routing, which is already a solved problem. Angular has a module which specifically addresses this. Benefits of switching to ng-router:
standard architecture is more familiar with ng-devs
navigate to any game module by modifying the url
reduces DOM-clutter (better performance?)
???
To maintain existing functionality the listeners set up in the Nodule class would also have to be adapted to use $locationChangeStart or similar instead of $on('swtichToModule',...
To maintain modularity, each new route should be declared in the module's controller rather than having all of them in the main application.
The controller/directive pairs used for game modules alongside
$.show()
andhide()
are attempting to do routing, which is already a solved problem. Angular has a module which specifically addresses this. Benefits of switching to ng-router:To maintain existing functionality the listeners set up in the Nodule class would also have to be adapted to use
$locationChangeStart
or similar instead of$on('swtichToModule',..
. To maintain modularity, each new route should be declared in the module's controller rather than having all of them in the main application.