Completed
Push — master ( 3ce364...b1ab6e )
by Andres
58s
created

src/scripts/component/reaction-table.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 24
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
c 2
b 0
f 0
nc 1
mnd 0
bc 2
fnc 2
dl 0
loc 24
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A reaction-table.js ➔ reactionTable 0 11 1
1
/**
2
 reactionTable
3
 Component for the table of reactions in the Reactor tab.
4
5
 @namespace Components
6
 */
7
'use strict';
8
9
angular.module('game').component('reactionTable', {
10
  templateUrl: 'views/reactionTable.html',
11
  controller: ['$scope', 'util', 'format', 'visibility', 'data', 'state', reactionTable],
12
  controllerAs: 'ct',
13
  bindings: {
14
    reactor: '<',
15
    element: '<',
16
    title: '<'
17
  }
18
});
19
20
function reactionTable($scope, util, format, visibility, data, state) {
21
  let ct = this;
22
  ct.util = util;
23
  ct.format = format;
24
  ct.data = data;
25
  ct.state = state;
26
27
  $scope.$watch('ct.element', function() {
28
      ct.reactionSelect = ct.reactor.availableReactions(ct.element)[0];
29
  });
30
}
31