I am saving chips in db using you form . But I want to update those chips too so I fetched data from db (chips) and wanted to show them as tags in update form so that user can delete them if he wanted to delete and can add more chips if he want. Here I don't know how to show already exist chips in update form (I have those chips in an array but don't know to which scope I have to assign them).
Chip form :
<md-chips ng-model="formData.selectedBrainframes" md-autocomplete-snap md-require-match>
<md-autocomplete
md-selected-item="selectedItem"
md-search-text="searchText"
md-items="item in querySearch(searchText)"
md-item-text="item.trans_title"
placeholder="Search for a Brainframe">
<span md-highlight-text="searchText">{$ item.trans_title $}</span>
</md-autocomplete>
<md-chip-template>
<span>
<strong>{$ $chip.trans_title $}</strong>
</span>
</md-chip-template>
</md-chips>
I think I have to assign them to this directive scope but how I don't know ?
In that case you just have to assign the existent chips to
formData.selectedBrainFrames
and they should be automatically populated.Check this codepen for a simple example