comparison src/app/relation-type.js @ 58:3b4046e0cc02 default

Merge from ng2-table branch. d7c947909ab888c013171b8c037e4f9fab30fe57
author casties
date Wed, 29 Mar 2017 17:19:12 +0200
parents
children
comparison
equal deleted inserted replaced
49:781a5387ca93 58:3b4046e0cc02
1 "use strict";
2 exports.invLabelPrefix = '<- ';
3 exports.invNamePrefix = '-';
4 exports.rawLabelPrefix = '(';
5 exports.rawLabelPostfix = ')';
6 var RelationType = (function () {
7 function RelationType(relType, isOutgoing, label) {
8 this.outgoing = isOutgoing;
9 this.relType = relType;
10 if (isOutgoing) {
11 this.name = relType;
12 }
13 else {
14 this.name = exports.invNamePrefix + relType;
15 }
16 if (label != null) {
17 this.label = label;
18 }
19 else {
20 // create label using name
21 if (isOutgoing) {
22 this.label = exports.rawLabelPrefix + relType + exports.rawLabelPostfix;
23 }
24 else {
25 this.label = exports.rawLabelPrefix + exports.invLabelPrefix + relType + exports.rawLabelPostfix;
26 }
27 }
28 }
29 RelationType.prototype.getLabel = function () {
30 return this.label;
31 };
32 RelationType.prototype.getName = function () {
33 return this.name;
34 };
35 RelationType.prototype.getRelType = function () {
36 return this.relType;
37 };
38 RelationType.prototype.isOutgoing = function () {
39 return this.outgoing;
40 };
41 return RelationType;
42 }());
43 exports.RelationType = RelationType;
44 //# sourceMappingURL=relation-type.js.map