In Chapter 8, Building a Simple Social App, we created tabs-app
. If you recall correctly, we added a new tab called walls
.
The basic idea we had for the wall
tab we added was that it would be like a message board where a user could type a post and then tap the button labeled Post to see it on the message board, as shown in the following screenshot:
The first thing we need to do is to implement our mechanism to allow users to post, as this does not currently work in our tab-app
application.
To recap what we want from our wall
tab, we want to be able to enter message in the message box, as seen in the preceding screenshot, and have the message appear like the sample message post. To begin, we start by implementing the code for adding a post in our controller.
This code is provided in the following code block:
$scope.post = { message : '' }; $scope.posts = []; $scope.addPost = function () { $scope.posts...