From 6c4f1b670b3dddcc2d615370253afb4c8f94dfd7 Mon Sep 17 00:00:00 2001 From: Vladimir Lugovsky Date: Tue, 7 Jun 2016 14:33:48 +0300 Subject: [PATCH] fix(demo): updated demo for switcher component --- .../inputs/widgets/switch/SwitchPanelCtrl.js | 24 +++++++++++++++++++ .../inputs/widgets/switch/switch.directive.js | 5 ++-- .../form/inputs/widgets/switch/switch.html | 12 +++++----- 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 src/app/pages/form/inputs/widgets/switch/SwitchPanelCtrl.js diff --git a/src/app/pages/form/inputs/widgets/switch/SwitchPanelCtrl.js b/src/app/pages/form/inputs/widgets/switch/SwitchPanelCtrl.js new file mode 100644 index 000000000..4ea425d57 --- /dev/null +++ b/src/app/pages/form/inputs/widgets/switch/SwitchPanelCtrl.js @@ -0,0 +1,24 @@ +/** + * @author v.lugovsky + * created on 07.06.2016 + */ +(function () { + 'use strict'; + + angular.module('BlurAdmin.pages.form') + .controller('SwitchPanelCtrl', SwitchPanelCtrl); + + /** @ngInject */ + function SwitchPanelCtrl() { + var vm = this; + + vm.switcherValues = { + primary: true, + warning: true, + danger: true, + info: true, + success: true + }; + } + +})(); diff --git a/src/app/pages/form/inputs/widgets/switch/switch.directive.js b/src/app/pages/form/inputs/widgets/switch/switch.directive.js index 0608a699b..7b2937c7c 100644 --- a/src/app/pages/form/inputs/widgets/switch/switch.directive.js +++ b/src/app/pages/form/inputs/widgets/switch/switch.directive.js @@ -16,10 +16,11 @@ scope: { ngModel: '=' }, - template: '
', + template: function(el, attrs) { + return '
'; + }, link: function (scope, elem, attr) { $timeout(function(){ - scope.color = attr.color; var input = $(elem).find('input'); input.bootstrapSwitch({ size: 'small', diff --git a/src/app/pages/form/inputs/widgets/switch/switch.html b/src/app/pages/form/inputs/widgets/switch/switch.html index dfc9645ce..c8b0034ba 100644 --- a/src/app/pages/form/inputs/widgets/switch/switch.html +++ b/src/app/pages/form/inputs/widgets/switch/switch.html @@ -1,7 +1,7 @@ -
- - - - - +
+ + + + +
\ No newline at end of file