angular-materialize icon indicating copy to clipboard operation
angular-materialize copied to clipboard

Too much recursion

Open Mirdrack opened this issue 9 years ago • 1 comments

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>

Mirdrack avatar Jan 02 '16 03:01 Mirdrack

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.

webbiesdk avatar May 15 '16 11:05 webbiesdk