@@ -12,28 +12,58 @@ angular.module('ui').controller('uiComponentController', ['$scope', 'UiEvents',
1212 var me = this ;
1313
1414 if ( typeof me . item . format === "string" ) {
15- me . item . getText = $interpolate ( me . item . format ) . bind ( null , me . item ) ;
15+ if ( me . item . format . indexOf ( "constructor" ) === - 1 ) {
16+ me . item . getText = $interpolate ( me . item . format ) . bind ( null , me . item ) ;
17+ }
18+ else {
19+ me . item . getText = function ( ) { return me . item . format } ;
20+ }
1621 }
1722
1823 if ( typeof me . item . label === "string" ) {
19- me . item . getLabel = $interpolate ( me . item . label ) . bind ( null , me . item ) ;
20- me . item . safeLabel = "nr-dashboard-widget-" + ( me . item . label ) . replace ( / \W / g, '_' ) ;
24+ if ( me . item . label . indexOf ( "constructor" ) === - 1 ) {
25+ me . item . getLabel = $interpolate ( me . item . label ) . bind ( null , me . item ) ;
26+ me . item . safeLabel = "nr-dashboard-widget-" + ( me . item . label ) . replace ( / \W / g, '_' ) ;
27+ }
28+ else {
29+ me . item . getText = function ( ) { return me . item . label } ;
30+ }
2131 }
2232
2333 if ( typeof me . item . tooltip === "string" ) {
24- me . item . getTooltip = $interpolate ( me . item . tooltip ) . bind ( null , me . item ) ;
34+ if ( me . item . tooltip . indexOf ( "constructor" ) === - 1 ) {
35+ me . item . getTooltip = $interpolate ( me . item . tooltip ) . bind ( null , me . item ) ;
36+ }
37+ else {
38+ me . item . getText = function ( ) { return me . item . tooltip } ;
39+ }
2540 }
2641
2742 if ( typeof me . item . color === "string" ) {
28- me . item . getColor = $interpolate ( me . item . color ) . bind ( null , me . item ) ;
43+ if ( me . item . color . indexOf ( "constructor" ) === - 1 ) {
44+ me . item . getColor = $interpolate ( me . item . color ) . bind ( null , me . item ) ;
45+ }
46+ else {
47+ me . item . getText = function ( ) { return me . item . color } ;
48+ }
2949 }
3050
3151 if ( typeof me . item . icon === "string" ) {
32- me . item . getIcon = $interpolate ( me . item . icon ) . bind ( null , me . item ) ;
52+ if ( me . item . icon . indexOf ( "constructor" ) === - 1 ) {
53+ me . item . getIcon = $interpolate ( me . item . icon ) . bind ( null , me . item ) ;
54+ }
55+ else {
56+ me . item . getText = function ( ) { return me . item . icon } ;
57+ }
3358 }
3459
3560 if ( typeof me . item . units === "string" ) {
36- me . item . getUnits = $interpolate ( me . item . units ) . bind ( null , me . item ) ;
61+ if ( me . item . units . indexOf ( "constructor" ) === - 1 ) {
62+ me . item . getUnits = $interpolate ( me . item . units ) . bind ( null , me . item ) ;
63+ }
64+ else {
65+ me . item . getText = function ( ) { return me . item . units } ;
66+ }
3767 }
3868
3969 me . init = function ( ) {
0 commit comments