Skip to content

Already select items with an existing array #35

@code-by-marc

Description

@code-by-marc

I am trying to select a few items from the suggestions-arr with items that are already in the ng-model. Couldn't find a use-case so I created this issue.

Getting the following error:
Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: item in modelArr, Duplicate key: string:", Duplicate value: "

When I use track by I'll get the next error:
Error: [$parse:syntax] Syntax Error: Token 'track' is an unexpected token at column 13 of the expression [$ctrl.types track by name] starting at [track by name].

My select code:

<multiple-autocomplete
    ng-model="$ctrl.acceptedTypes"
    object-property="name"
    suggestions-arr="$ctrl.types"
    id="acceptedTypes">
</multiple-autocomplete>

$ctrl is used because I work with component instead of directives

Anybody an idea how to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions