I have JSON:

```
$scope.allTags=[
        {id: 1, name: 'name1', description: 'description1', title: 'title1'},
        {id: 2, name: 'name2', description: 'description1', title: 'title1'},
        {id: 3, name: 'name3', description: 'description2', title: 'title2'},
        {id: 4, name: 'name4', description: 'description2', title: 'title2'},
        {id: 5, name: 'name5', description: 'description3', title: 'title3'},
        {id: 6, name: 'name6', description: 'description3', title: 'title3'},
        {id: 7, name: 'name7', description: 'description3', title: 'title3'},
    ];

```

And I need to create BS accordion like this:

```
<a data-toggle="collapse" data-parent="#tags-accordion" href="#col_Iesaukumi1">Title1</a></br>
<div id="col_Iesaukumi1" class="collapse">
    <span>name1</span><span>name2</span>
</div>
<a data-toggle="collapse" data-parent="#tags-accordion" href="#col_Iesaukumi2">Title2</a></br>
<div id="col_Iesaukumi2" class="collapse">
    <span>name3</span><span>name4</span>
</div><a data-toggle="collapse" data-parent="#tags-accordion" href="#col_Iesaukumi3">Title3</a></br>
<div id="col_Iesaukumi3" class="collapse">
    <span>name5</span><span>name6</span>span>name7</span>
</div>

```

And its killing me. I am new to angular and strugle with this task. In plain JS I did something like this:

```
    var prev = null;
    var counter = 1;
    for(var i = 0; i < allTags.length; i++){
        if(prev != allTags[i].title){
            if(prev != null){
                html += '</div>';
            }
            html += '<a data-toggle="collapse" data-parent="#tags-accordion" href="#col_collapse'+counter+'">'+allTags[i].title+'</a><a href="#" data-toggle="tooltip" title="'+allTags[i].description+'"><i class="fa fa-info-circle" aria-hidden="true"></i></a></br>';
            html+='<div id="col_collapse'+counter+'" class="collapse">';
            prev = allTags[i].title;
            counter++;
        }
        html += '<span class="tagi" data-type="tags" data-value="'+allTags[i].id+'">'+allTags[i].name+'</span>';
    }
    html += '</div>';

```

However I can not understand how use this tech with angular.