stackviz/app/js/directives/tempest-summary.js
Tim Buckley a22de1964c Add missing DI annotations and enable strictDi.
This adds missing `@ngInject` annotations to 2 directives and enables
angular's strictDi mode. This patch should fix bulids produced with
`gulp prod` that were unusable due to DI errors.

Change-Id: Ib3c8810c24afb3c859029d2f8eaf9044416b6fa3
2016-01-04 17:03:03 -07:00

32 lines
625 B
JavaScript

'use strict';
var directivesModule = require('./_index.js');
/**
* @ngInject
*/
function tempestSummary() {
/**
* @ngInject
*/
var controller = function($scope, $attrs, datasetService) {
$scope.$watch('dataset', function(dataset) {
var stats = dataset.stats;
$scope.stats = stats;
$scope.timeDiff = (new Date(stats.end) - new Date(stats.start)) / 1000;
});
};
return {
restrict: 'EA',
scope: {
'dataset': '='
},
controller: controller,
templateUrl: 'directives/tempest-summary.html'
};
}
directivesModule.directive('tempestSummary', tempestSummary);