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

Issue 1820 #1830

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Issue 1820 #1830

wants to merge 6 commits into from

Conversation

zajacmp3
Copy link

In response to issue raised: #1820

I have added a new html tag called object-unique-key.
This tag allows us to define based on what we define if an object is or is not unique.

Mateusz Zajac and others added 5 commits October 20, 2016 04:27
Added a new optional attribute called objectUniqueKey for ui-select html tag. That if defined it will allow to decide if objects given are unique bases on a key defined in this attribute.
@user378230
Copy link
Contributor

Shouldn't we actually just be using the value specified in track by?

It appears we are duplicating functionality with this.

@zajacmp3
Copy link
Author

I'll investigate that and get back to you with an answer by the end of the weekend.

@zajacmp3
Copy link
Author

@user378230

I failed to reproduce my solution with track by so personally I would opt to say that we are not duplicating functionality. While doing code analysis when using multiple select and tagging there is no other logic that compare objects. I modified the only one in a generic way.

During my investigation I found out that:
track by is used in directive used to show choices/match items and to support ng-repeat directive
<ui-select-choices repeat="address in ctrl.addresses track by $index"
http://angular-ui.github.io/ui-select/demo-basic.html

* Original discussion about parsing "repeat" attribute instead of fully relying on ng-repeat:
* https://github.com/angular-ui/ui-select/commit/5dd63ad#commitcomment-5504697

uisRepeatParserService.js:7-8

  self.getGroupNgRepeatExpression = function() {
    return '$group in $select.groups track by $group.name';
  };

So track by does not seems to do the trick at the minute.

But maybe you wanted to ask could we re use track by argument in ui select directive as it seems that we might not want to add yet another argument to directive?

Copy link

@UsamaKhalil-KSO UsamaKhalil-KSO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awsome, we need this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants