routes.js 726 B

123456789101112131415161718192021222324
  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. controllerAs: 'showController'
  9. })
  10. .when("/notes", {
  11. templateUrl: "templates/pages/notes/index.html",
  12. controller: 'NotesIndexController',
  13. controllerAs: 'indexController'
  14. })
  15. .when("/users", {
  16. templateUrl: "templates/pages/users/index.html"
  17. })
  18. .when("/", {
  19. templateUrl: "templates/pages/notes/index.html"
  20. })
  21. .otherwise({
  22. redirectTo: "/"
  23. });
  24. });