mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #11483 from grafana/playlist-routes-to-ts
migrated playlist-routes to ts
This commit is contained in:
commit
dc4cb0d565
@ -1,39 +0,0 @@
|
|||||||
define([
|
|
||||||
'angular',
|
|
||||||
'lodash'
|
|
||||||
],
|
|
||||||
function (angular) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var module = angular.module('grafana.routes');
|
|
||||||
|
|
||||||
module.config(function($routeProvider) {
|
|
||||||
$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', {
|
|
||||||
templateUrl: 'public/app/features/playlist/partials/playlists.html',
|
|
||||||
controllerAs: 'ctrl',
|
|
||||||
controller : 'PlaylistsCtrl',
|
|
||||||
resolve: {
|
|
||||||
init: function(playlistSrv, $route) {
|
|
||||||
var playlistId = $route.current.params.id;
|
|
||||||
playlistSrv.start(playlistId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
33
public/app/features/playlist/playlist_routes.ts
Normal file
33
public/app/features/playlist/playlist_routes.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import angular from 'angular';
|
||||||
|
|
||||||
|
function grafanaRoutes($routeProvider) {
|
||||||
|
$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', {
|
||||||
|
templateUrl: 'public/app/features/playlist/partials/playlists.html',
|
||||||
|
controllerAs: 'ctrl',
|
||||||
|
controller: 'PlaylistsCtrl',
|
||||||
|
resolve: {
|
||||||
|
init: function(playlistSrv, $route) {
|
||||||
|
let playlistId = $route.current.params.id;
|
||||||
|
playlistSrv.start(playlistId);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
angular.module('grafana.routes').config(grafanaRoutes);
|
Loading…
Reference in New Issue
Block a user