Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Potential issue in the documentation #11768

Closed
gcoutable opened this issue Apr 30, 2015 · 5 comments
Closed

Potential issue in the documentation #11768

gcoutable opened this issue Apr 30, 2015 · 5 comments

Comments

@gcoutable
Copy link

Hi,

I was looking for some documentation about ngOption and I found this potential issue.

Here is a caution that warns us to do not use 'as' and 'track by' in the same expression :
https://github.com/angular/angular.js/blob/master/src/ng/directive/ngOptions.js#L61

But the next example, uses 'as' and 'track by' in the same expression :
https://github.com/angular/angular.js/blob/master/src/ng/directive/ngOptions.js#L67

Is that normal?

Regards,

Guillaume

@gkalpak
Copy link
Member

gkalpak commented Apr 30, 2015

@gcoutable, it's an "anti-example". It basically showcases what you shouldn't do and explains why it's not possible. In that sense, it's OK-ish.

Reading the explanation though, it seems that - while item.a as item.b for item in items track by item.c is not possible - using item as item.b for item in items track by item.c should be possible.

@petebacondarwin, should the documentation be updated (since the later is the most common usecase imo). I can't think of a good way to describe that when using track by and select as the select part should be the item itself.

@petebacondarwin
Copy link
Contributor

The documentation should indeed be improved. I will take a look today as I am messing with ngOptions anyway.

@petebacondarwin petebacondarwin self-assigned this May 1, 2015
@petebacondarwin petebacondarwin modified the milestones: 1.4.0-rc.2, 1.4.x - jaracimrman-existence May 1, 2015
@petebacondarwin
Copy link
Contributor

I don't have time to do this. Would anyone else like to provide a PR?

@petebacondarwin petebacondarwin modified the milestones: Backlog, 1.4.x Jul 30, 2015
@petebacondarwin petebacondarwin removed their assignment Jul 30, 2015
@ryanhart2
Copy link
Contributor

I submitted pull request #13000 to address this.

@Narretz
Copy link
Contributor

Narretz commented Dec 10, 2015

The PR has been merged IIRC

@Narretz Narretz closed this as completed Dec 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants