Since AngularJS 1.2, the router has been packaged as a separate module outside of Angular's core. The file we're looking for—angular-route.min.js
—can be downloaded from Angular's website below the Extras section within the download window.
Once you've got the download, drag it into your project's js
directory and include it in the page after AngularJS:
<script src="assets/js/angular-route.min.js"></script>
We also need to let our module know that we want to utilize the router. We can do this by adding it to the module's dependency list. We can have as many dependencies as we like; currently all we need to include is ngRoute
:
angular.module('contactsMgr', ['ngRoute'])