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

Too much recursion #110

Open
Mirdrack opened this issue Jan 2, 2016 · 1 comment
Open

Too much recursion #110

Mirdrack opened this issue Jan 2, 2016 · 1 comment

Comments

@Mirdrack
Copy link

Mirdrack commented Jan 2, 2016

Hello:
I'm trying to make a form with some selects but when I try to add more than one select I get this error

InternalError: too much recursion

I wish could provide more info but only notice this when I include the material-select directive on the second select
If I don't include the directive, the select is rendered but as hidden element(I don't know why this happens too)

Maybe I'm missing something but here is my code for the view hope it helps...

<h1>Generate Report</h1>

<div class="row">
    <div class="input-field col s4">
        <select 
            ng-model="stationId" 
            ng-options="station.id as station.name for station in stations" 
            material-select>
            <option value="">Select Station</option>
        </select>
    </div>
</div>

<div class="row">
    <div class="input-field col s4">
        <select ng-model="reportType" material-select >
            <option value="">Select type</option>
            <option value="day">By Day</option>
            <option value="month">By Month</option>
            <option value="year">By Year</option>
        </select>
    </div>
</div>

Just remark that the problem comes up when I add the material-select directive for the second time
Thanks in advance

Update 1

Just to complement If I delete the ng-model on my view the error is gone, but obviously i need the ng-model directive in order get the value from the select.

Update 2

If I initialize the options for my second select on my controller and then set it up my view with ng-options, everything runs perfect.
I hope this helps if somebody has the same but I'm still thinking this is a wrong behavior
Thanks again, let me know if I can help with something.

Controller

$scope.typeOptions = [
        {
            value: 'day',
            label: 'Day'
        },
        {
            value: 'month',
            label: 'Month'
        },
        {
            value: 'year',
            label: 'Year'
        },
    ];

View

<div class="row">
    <div class="input-field col s4">
        <select 
        ng-model="reportType"
        ng-options="typeOption.value as typeOption.label for typeOption in typeOptions" 
        material-select >
            <option value="">Select type</option>
        </select>
    </div>
</div>
@webbiesdk
Copy link
Collaborator

The material-select has changed a lot in #143, which might have fixed this issue.

So you have to test with the latest version, before i can proceed.

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

No branches or pull requests

2 participants