grafana/public/app/features/playlist/playlist_routes.ts

34 lines
1005 B
TypeScript
Raw Normal View History

2018-04-04 08:26:23 -05:00
import angular from 'angular';
import { PlaylistSrv } from './playlist_srv';
2018-04-04 08:26:23 -05:00
/** @ngInject */
function grafanaRoutes($routeProvider: any) {
2018-04-04 08:26:23 -05:00
$routeProvider
.when('/playlists', {
templateUrl: 'public/app/features/playlist/partials/playlists.html',
controllerAs: 'ctrl',
controller: 'PlaylistsCtrl',
})
.when('/playlists/create', {
templateUrl: 'public/app/features/playlist/partials/playlist.html',
controllerAs: 'ctrl',
controller: 'PlaylistEditCtrl',
})
.when('/playlists/edit/:id', {
templateUrl: 'public/app/features/playlist/partials/playlist.html',
controllerAs: 'ctrl',
controller: 'PlaylistEditCtrl',
})
.when('/playlists/play/:id', {
template: '',
2018-04-04 08:26:23 -05:00
resolve: {
init: (playlistSrv: PlaylistSrv, $route: any) => {
const playlistId = $route.current.params.id;
2018-04-04 08:26:23 -05:00
playlistSrv.start(playlistId);
},
},
});
}
angular.module('grafana.routes').config(grafanaRoutes);