routes.js 913 B

123456789101112131415161718192021222324252627
  1. angular.module("noteWrangler")
  2. .config(function ($routeProvider, $locationProvider) {
  3. $locationProvider.hashPrefix('');
  4. $routeProvider
  5. .when("/notes/:id", {
  6. templateUrl: "templates/pages/notes/show.html",
  7. controller: 'NotesShowController',
  8. // No longer needed since we now pass $scope to controller.
  9. // controllerAs: 'showController'
  10. })
  11. .when("/notes", {
  12. templateUrl: "templates/pages/notes/index.html",
  13. controller: 'NotesIndexController',
  14. // No longer needed since we now pass $scope to controller.
  15. // controllerAs: 'indexController'
  16. })
  17. .when("/users", {
  18. templateUrl: "templates/pages/users/index.html",
  19. controller: 'UsersIndexController',
  20. })
  21. .when("/", {
  22. templateUrl: "templates/pages/notes/index.html"
  23. })
  24. .otherwise({
  25. redirectTo: "/"
  26. });
  27. });