playlist_routes.js 1.1 KB

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