Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Change Property Prefix from "_" to "$" so that angular built-in functions ignore them #1641

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/uiSelectController.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ uis.controller('uiSelectCtrl',
if (itemIndex >= 0 && (!angular.isUndefined(ctrl.disableChoiceExpression) || ctrl.multiple)) {
item = ctrl.items[itemIndex];
isDisabled = !!(itemScope.$eval(ctrl.disableChoiceExpression)) || _isItemSelected(item); // force the boolean value
item._uiSelectChoiceDisabled = isDisabled; // store this for later reference
item.$uiSelectChoiceDisabled = isDisabled; // store this for later reference
}

return isDisabled;
Expand All @@ -344,11 +344,11 @@ uis.controller('uiSelectCtrl',

// When the user selects an item with ENTER or clicks the dropdown
ctrl.select = function(item, skipFocusser, $event) {
if (item === undefined || !item._uiSelectChoiceDisabled) {
if (item === undefined || !item.$uiSelectChoiceDisabled) {

if ( ! ctrl.items && ! ctrl.search && ! ctrl.tagging.isActivated) return;

if (!item || !item._uiSelectChoiceDisabled) {
if (!item || !item.$uiSelectChoiceDisabled) {
if(ctrl.tagging.isActivated) {
// if taggingLabel is disabled, we pull from ctrl.search val
if ( ctrl.taggingLabel === false ) {
Expand Down Expand Up @@ -449,7 +449,7 @@ uis.controller('uiSelectCtrl',

if (item && !angular.isUndefined(ctrl.lockChoiceExpression)) {
isLocked = !!(itemScope.$eval(ctrl.lockChoiceExpression)); // force the boolean value
item._uiSelectChoiceLocked = isLocked; // store this for later reference
item.$uiSelectChoiceLocked = isLocked; // store this for later reference
}

return isLocked;
Expand Down
2 changes: 1 addition & 1 deletion src/uiSelectMultipleDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
var removedChoice = $select.selected[index];

// if the choice is locked, can't remove it
if(removedChoice._uiSelectChoiceLocked) return;
if(removedChoice.$uiSelectChoiceLocked) return;

var locals = {};
locals[$select.parserResult.itemName] = removedChoice;
Expand Down