Here is the JSON data:
streams = [{ id: 0,
codec_type: 'video',
content: '1920x1040 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10' },
{ id: 1,
codec_type: 'audio',
content: '5.1(side) - cze - undefined' },
{ id: 2,
codec_type: 'audio',
content: '5.1(side) - eng - undefined' },
{ id: 3, codec_type: 'subtitle', content: 'cze - Czech' },
{ id: 4, codec_type: 'subtitle', content: 'eng - English' }];
This is how it looks in Angular HTML markup:
<md-input-container ng-repeat="stream in streams">
<label>{{stream.codec_type}}</label>
<md-select ng-model="stream">
<md-option value="{{stream.id}}">{{stream.content}}</md-option>
</md-select>
</md-input-container>
Hello! I am trying to locate duplicate strings within the JSON and display only one select field with multiple options for each duplicate (codec_type). Any suggestions on how to achieve this efficiently? Thank you!
!!! UPDATE !!!
I realize that I need to redesign the JSON structure and work with objects separately or employ a different approach for handling this situation.