I use ng-repeat to display different content (i.e. elements in an array) in different modal bootstraps, however, something strange happens in this example .
I include 'modal' in ng-repeat as follows:
<div ng-repeat="item in items"> <button type="button" class="btn btn-info" data-toggle="modal" data-target="#example"> {{item}} </button> <div class="modal" id="example"> <div class="modal-content"> {{item}} </div> </div> </div>
Thus, the expected result should consist of three buttons with three different contents (for example, <button> 'hi' should have hi content, hello has hello content), however, as you see in the example, all three buttons have the same button associated with them content
Any suggestions or comments are appreciated.
javascript html angularjs twitter-bootstrap angularjs-ng-repeat
leonsPAPA
source share