diff --git a/.gitignore b/.gitignore index a088b6f..294e34a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules bower_components +.idea diff --git a/angular-ui-switch.js b/angular-ui-switch.js index 4108863..c642bc8 100644 --- a/angular-ui-switch.js +++ b/angular-ui-switch.js @@ -9,7 +9,8 @@ angular.module('uiSwitch', []) var html = ''; html += ''+attrs.on+'' : ''; /*switch text on value set by user in directive html markup*/ - html += attrs.off ? ''+attrs.off + '' : ' '; /*switch text off value set by user in directive html markup*/ - html += ''; + if (attrs.on || attrs.off) { + html += ''; /*adding new container for switch text*/ + html += attrs.on ? ''+attrs.on+'' : ''; /*switch text on value set by user in directive html markup*/ + html += attrs.off ? ''+attrs.off + '' : ' '; /*switch text off value set by user in directive html markup*/ + html += ''; + } return html; } }