I'm attempting to dynamically order a list of items in AngularJS based on user input text. For example, if I type "author" into the input field, the list should be sorted by author.
Here is my code:
<input type = "text" ng-model = "sort">
<ul class = "list-unstyled">
<li ng-repeat = "comment in dishCtrl.dish.comments | orderBy: sort">
<blockquote class = "blockquote">
<p>{{comment.rating}} Stars </p>
<p>{{comment.comment}}</p>
<footer>{{comment.author}}, {{comment.date | date}</footer>
</blockquote>
</li>
Unfortunately, this code is not functioning as expected. I have searched extensively but have been unable to find an example that addresses this issue.