UNPKG

stf-angular-select

Version:

Custom reusable select for angular with wide posibilities

27 lines (26 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var StfSelectOptionDirective = (function () { function StfSelectOptionDirective() { this.transclude = true; this.restrict = 'E'; this.template = "\n <section ng-class=\"{'stf-select-option__selected': modelVaule===ngValue}\" tabindex=\"0\" class=\"stf-select-option\" data-ng-click=\"selectValue()\" ng-transclude></section>\n "; this.scope = { ngValue: "<?", value: "@?" }; } StfSelectOptionDirective.prototype.link = function (scope, element, attrs) { scope.selectValue = function () { scope.$emit("stf-select-option.selected", scope.ngValue || scope.value); }; scope.$on('stf-select.value_changed', function (event, model) { scope.modelVaule = model; }); }; StfSelectOptionDirective.Factory = function () { return new StfSelectOptionDirective(); }; return StfSelectOptionDirective; }()); exports.StfSelectOptionDirective = StfSelectOptionDirective;