Brand new to AngularJS so any help would be greatly appreciated.
I have a modal that brings up some information about companies.
Link here: http://104.236.181.252:49156/#portfolio
As you can see i can move between companies using the previous and next buttons, however i want the user to be able to use left and right keyboard keys. I've used the ng-keydown directive inside a div but with no such luck. Here's my modal code that changes pages:
<div class="modal-footer" ng-controller="portfolio">
<nav>
<ul class="pager">
<li class="previous"><a href="" ng-click="prevPage(co)"><span aria-hidden="true">←</span> Previous</a></li>
<li class="next"><a href="" ng-click="nextPage(co)">Next<span aria-hidden="true">→</span></a></li>
</ul>
</nav>
</div>
when i press either the left or right keyboard keys, i want to be able to cycle through prevPage(co)
and nextPage(co)
respectively.
EDIT
Here's my modal code:
<script type="text/ng-template" id="myModalContent.html" ng-keydown="">
<div class="modal-header">
<img class="displayed lightbox" src="{{co.logo}}" tabindex="1">
<button type="button" class="close" data-dismiss="modal" ng-click="cancel()">
<span aria-hidden="true">×</span><span class="sr-only">
</span>
</button>
</div>
<div class="modal-body" id="currentModal">
<div class="social_links">
<a class="social_icon" href="{{co.url}}">
<img src="img/web.png">
</a>
<a class="social_icon" href="{{co.crunchbase_url}}">
<img src="img/crunchbase-2.png">
</a>
<a class="social_icon" href="{{co.angellist_url}}">
<img src="img/angellist.ico">
</a>
<a class="social_icon" href="{{co.twitter_url}}">
<img src="img/icon-twitter.png">
</a>
</div>
<div class="row companyd">
{{ co.investor_description }}
<div class="line-separator" ng-if="co.founders"></div>
<h5 ng-if="co.founders">Founders</h5>
<div ng-repeat="founder in co.founders" >
<div class="span-4 founderimg" ng-if="co.founders.length == 3">
<img src="{{founder.founder_pic}}" style="height:100px" class="founders" ng-if="founder.founder_pic != null">
<img src="http://korea.fas.harvard.edu/sites/korea.fas.harvard.edu/files/imagecache/profile_page/imagefield_default_images/default_profile_icon_0.png" style="width:100px" class="founders" ng-if="founder.founder_pic == null"><br><a href="{{founder.linkedin_url}}">{{founder.founder_name}}</a>
</div>
<div class="span-6 founderimg" ng-if="co.founders.length == 2">
<img src="{{founder.founder_pic}}" style="height:100px" class="founders" ng-if="founder.founder_pic != null">
<img src="http://korea.fas.harvard.edu/sites/korea.fas.harvard.edu/files/imagecache/profile_page/imagefield_default_images/default_profile_icon_0.png" style="width:100px" class="founders" ng-if="founder.founder_pic == null"><br><a href="{{founder.linkedin_url}}">{{founder.founder_name}}</a>
</div>
<div class="span-12 founderimg" ng-if="co.founders.length == 1">
<img src="{{founder.founder_pic}}" style="height:100px" class="founders" ng-if="founder.founder_pic != null">
<img src="http://korea.fas.harvard.edu/sites/korea.fas.harvard.edu/files/imagecache/profile_page/imagefield_default_images/default_profile_icon_0.png" style="width:100px" class="founders" ng-if="founder.founder_pic == null"><br><a href="{{founder.linkedin_url}}">{{founder.founder_name}}</a>
</div>
<div class="span-3 founderimg" ng-if="co.founders.length == 4">
<img src="{{founder.founder_pic}}" style="height:100px" class="founders" ng-if="founder.founder_pic != null">
<img src="http://korea.fas.harvard.edu/sites/korea.fas.harvard.edu/files/imagecache/profile_page/imagefield_default_images/default_profile_icon_0.png" style="width:100px" class="founders" ng-if="founder.founder_pic == null"><br><a href="{{founder.linkedin_url}}">{{founder.founder_name}}</a>
</div>
</div>
</div>
</div>
<div class="modal-footer" ng-controller="portfolio">
<div ng-keypress="myFunct($event)">
<nav>
<ul class="pager">
<li class="previous"><a href="" ng-click="prevPage(co)"><span aria-hidden="true">←</span> Previous</a></li>
<li class="next"><a href="" ng-click="nextPage(co)">Next<span aria-hidden="true">→</span></a></li>
</ul>
</nav>
</div>
</div>
</script>