playlist_routes.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. define([
  2. 'angular',
  3. 'lodash'
  4. ],
  5. function (angular) {
  6. 'use strict';
  7. var module = angular.module('grafana.routes');
  8. module.config(function($routeProvider) {
  9. $routeProvider
  10. .when('/playlists', {
  11. templateUrl: 'public/app/features/playlist/partials/playlists.html',
  12. controllerAs: 'ctrl',
  13. controller : 'PlaylistsCtrl'
  14. })
  15. .when('/playlists/create', {
  16. templateUrl: 'public/app/features/playlist/partials/playlist.html',
  17. controllerAs: 'ctrl',
  18. controller : 'PlaylistEditCtrl'
  19. })
  20. .when('/playlists/edit/:id', {
  21. templateUrl: 'public/app/features/playlist/partials/playlist.html',
  22. controllerAs: 'ctrl',
  23. controller : 'PlaylistEditCtrl'
  24. })
  25. .when('/playlists/play/:id', {
  26. templateUrl: 'public/app/features/playlist/partials/playlists.html',
  27. controllerAs: 'ctrl',
  28. controller : 'PlaylistsCtrl',
  29. resolve: {
  30. init: function(playlistSrv, $route) {
  31. var playlistId = $route.current.params.id;
  32. playlistSrv.start(playlistId);
  33. }
  34. }
  35. });
  36. });
  37. });