/// import config from 'app/core/config'; import _ from 'lodash'; import $ from 'jquery'; import coreModule from 'app/core/core_module'; import Drop from 'tether-drop'; var template = `
`; export class SwitchCtrl { onChange: any; checked: any; show: any; id: any; /** @ngInject */ constructor($scope, private $timeout) { this.show = true; this.id = $scope.$id; } internalOnChange() { return this.$timeout(() => { return this.onChange(); }); } } export function switchDirective() { return { restrict: 'E', controller: SwitchCtrl, controllerAs: 'ctrl', bindToController: true, scope: { checked: "=", label: "@", labelClass: "@", tooltip: "@", switchClass: "@", onChange: "&", }, template: template, }; } coreModule.directive('gfFormSwitch', switchDirective);