Browse Source

fix: fixed issue with optimized build grid directive missing ngInject comment, fixes #10161

Torkel Ödegaard 8 years ago
parent
commit
79d9b64f82

+ 1 - 1
public/app/features/dashboard/all.ts

@@ -19,7 +19,7 @@ import './export/export_modal';
 import './export_data/export_data_modal';
 import './ad_hoc_filters';
 import './repeat_option/repeat_option';
-import './dashgrid/DashboardGrid';
+import './dashgrid/DashboardGridDirective';
 import './dashgrid/PanelLoader';
 import './dashgrid/RowOptions';
 import './acl/acl';

+ 0 - 4
public/app/features/dashboard/dashgrid/DashboardGrid.tsx

@@ -1,5 +1,4 @@
 import React from 'react';
-import coreModule from 'app/core/core_module';
 import ReactGridLayout from 'react-grid-layout';
 import {GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT} from 'app/core/constants';
 import {DashboardPanel} from './DashboardPanel';
@@ -174,6 +173,3 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
   }
 }
 
-coreModule.directive('dashboardGrid', function(reactDirective) {
-  return reactDirective(DashboardGrid, [['getPanelContainer', {watchDepth: 'reference', wrapApply: false}]]);
-});

+ 4 - 0
public/app/features/dashboard/dashgrid/DashboardGridDirective.ts

@@ -0,0 +1,4 @@
+import { react2AngularDirective } from 'app/core/utils/react2angular';
+import { DashboardGrid } from './DashboardGrid';
+
+react2AngularDirective('dashboardGrid', DashboardGrid, [['getPanelContainer', {watchDepth: 'reference', wrapApply: false}]]);