mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
23 lines
459 B
JavaScript
23 lines
459 B
JavaScript
define([
|
|
'angular',
|
|
'lodash'
|
|
],
|
|
function (angular) {
|
|
'use strict';
|
|
|
|
var module = angular.module('grafana.controllers');
|
|
|
|
module.controller('JsonEditorCtrl', function($scope) {
|
|
|
|
$scope.json = angular.toJson($scope.object, true);
|
|
$scope.canUpdate = $scope.updateHandler !== void 0;
|
|
|
|
$scope.update = function () {
|
|
var newObject = angular.fromJson($scope.json);
|
|
$scope.updateHandler(newObject, $scope.object);
|
|
};
|
|
|
|
});
|
|
|
|
});
|