To set the id attribute of an HTML element dynamically with angularjs (1.x) ngAttr directive can be used.
Here’s the code:-
<div ng-attr-id="{{ 'object-' + myScopeObject.index }}"></div>
The above code will get interpolated into:-
<div id="object-1"></div>