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

$repeat doesn't use array.length #39

Open
djgrant opened this issue Jun 30, 2015 · 1 comment
Open

$repeat doesn't use array.length #39

djgrant opened this issue Jun 30, 2015 · 1 comment

Comments

@djgrant
Copy link

djgrant commented Jun 30, 2015

Not sure if a mistake in documentation or a bug.

The documentation say that $repeat "reflects the .length of the array" https://github.com/Famous/framework-guides/blob/develop/control-flow.md

But:

'.el': {
            '$repeat': function() {
                var arr = new Array(3);
                return arr;
            }
}

Results in no elements being repeated.

@Imti
Copy link
Contributor

Imti commented Jun 30, 2015

Looks like a bug to me.

It seems that we're doing a falsey check somewhere since pushing false / undefined / 0 to the array also breaks it.

'$repeat': function() {
    var messages = [];
    for (var i = 0; i < 360; i++) {
        messages.push(false);
    }
    return messages;
}

We'll look into this.

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

2 participants