Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create New Scope element with directive instead of sub directive. #8

Open
mbostwick opened this issue Feb 7, 2017 · 0 comments
Open

Comments

@mbostwick
Copy link

mbostwick commented Feb 7, 2017

I'm using your directive for an app but because of how you used scope, I'm not able to use the index on the element with the directive.

i.e you would expect to see 50 lines, but you end up with 100 because of the scoping.

<div ng-repeat-n="100" ng-show="$index < 50">
This index will print {{$index}}
</div>

example:
http://jsfiddle.net/qejrsw4n/6/

Its really problematic if your dealing with tables, where you can't just insert spans or divs where ever you want, and where you may want to adjust colspans based on the index. I'm not likely to create a pull request with my results because I broke your code up into easier to read functions.

https://gist.github.com/mbostwick/48f197d0761a7a17bc3e4fdc9221f2a4

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

No branches or pull requests

1 participant