showOffenders.js 762 B

1234567891011121314151617
  1. var app = angular.module("ShowOffendersDirective", []);
  2. app.directive('showOffenders', function() {
  3. return {
  4. restrict: 'E',
  5. transclude: true,
  6. scope: {
  7. modalTitle: "@",
  8. metricName: "@",
  9. phantomasResults: "="
  10. },
  11. controller: function($scope, $element, $attrs, $location) {
  12. $scope.dialogShown = false;
  13. },
  14. template: '&nbsp;<span ng-click="dialogShown = true" class="icon-eye" title="See offenders"></span><modal-dialog show="dialogShown" dialog-title="{{modalTitle}}: {{phantomasResults.metrics[metricName]}}" width="70%"><ul><li ng-repeat="offender in phantomasResults.offenders[metricName] track by $index">{{offender}}</li></ul></modal-dialog>'
  15. };
  16. });