August 2017
Beginner
374 pages
10h 41m
English
Finally, we will focus on how to dispatch an action to the Redux store when the user does something.
Edit the <li> element, and add the ng-click attribute:
<li ng-repeat="post in posts" ng-click="editPost($index, post.text + '!')">
When a user clicks on a blog post, we use the editPost action creator to add an exclamation point at the end of the text. To edit the current blog post, we pass the $index value of the array (which, in our example, is the ID of the blog post).

We successfully reproduced ...
Read now
Unlock full access