mardi 5 mai 2015

Angular JS Can't interpolate: $selectMultiple.getPlaceholder()

So, i have this implementation of multi select ui on a form with other fields:

This is the view:

<div class="form-group">
<label for="components" class="col-sm-2 control-label">Components</label>
<div class="col-sm-10">
  <ui-select multiple ng-model="service.components" theme="bootstrap">
        <ui-select-match placeholder="Select a component">{{ $item.name }}</ui-select-match>
            <ui-select-choices repeat="component in components">
                <small ng-bind-html="component.name"></small>
        </ui-select-choices>
    </ui-select>
</div>

And in the backend i get the data on this way:

http.get('config/init_data.json').then(function(res) {
    service.components = res.data.components;
});

When i perform the submit function, everything works fine, get the data in the multiselect, show me the selected ones and creates the object perfectly. The problem is when i want to perform the same action for second time... in that case i get the error:

Error: [$interpolate:interr] Can't interpolate: {{$selectMultiple.getPlaceholder()}} TypeError: Cannot read property 'length' of undefined

ui-select error “Can't interpolate: {{$select.getPlaceholder()}}” have the same problem but the solution don't work for me.

Any ideas? Thank you some much for your help.

Aucun commentaire:

Enregistrer un commentaire