routes.js 868 B

1234567891011121314151617181920212223242526
  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. })
  20. .when("/", {
  21. templateUrl: "templates/pages/notes/index.html"
  22. })
  23. .otherwise({
  24. redirectTo: "/"
  25. });
  26. });