I have a scenario where I display many posts on a HTML page using AngularJS and every post, when clicked, shows associated data in an overlay. Data is displayed on main page using ng-repeat
tag and when any one item is clicked, HTML overlay, defined in the same page opens.
Problem:
Only first result is shown on every item i.e. whenever I click on any post with different id, it opens displaying only first id. That's incorrect. For example, if my result is:
- Windsor hotel,
- Chancery
- le Merridian.
and whenever an overlay is opened, it always shows Windsor for all.
Below is the code. please suggest.::
<div ng-repeat="post in allposts" style="background-color: #f8efc0" class="col-xs-10 col-md-11">
<div>
<a href="http://www.jquery2dotnet.com/2013/10/google-style-login-page-desing-usign.html">{{ post.postText}}</a>
<div class="mic-info">
By: <a href="#">{{ post.userEmail}}</a> on 2 March 2014
</div>
</div>
<div class="action">
<a href="#" class="btn btn-default btn-primary btn-xs">Your post is really helpful
<span class="glyphicon glyphicon-thumbs-up"></span></a>
<a href="#" class="btn btn-default btn-warning btn-xs active">would suggest, be
specific in your requirement <span
class="glyphicon glyphicon-thumbs-down"></span></a>
<!-- <button type="button" class="btn btn-danger btn-xs" title="Delete">
<span class="glyphicon glyphicon-trash"></span>
</button>-->
</div>
<a href="#"
data-toggle="modal"
data-target="#t_and_c_m">Comments of the post!</a>
<div class="modal fade" id="t_and_c_m" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Terms & Conditions</h4>
</div>
<div class="modal-body">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'pingled'; // required: replace example with your forum shortname
var disqus_identifier = 'postid';
alert(disqus_identifier);
var disqus_url = '';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
disqus_shortname = 'pingled'; // required: replace example with your forum shortname
disqus_identifier = undefined;
disqus_url = undefined;
</script>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>