July 2017
Intermediate to advanced
374 pages
8h
English
Once this is done, we need to now bind our data with the form and its field, as shown in the following code:
<form data-bind="submit: addTweet">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Tweet App Demo</a>
</div>
</div>
<div id="main" class="container">
<table class="table table-striped">
Username: <input data-bind="value: username" placeholder="Username" type="username"></input>
</div>
<div>
body: <textarea data-bind="value: body" placeholder="Content of tweet" type="text"></textarea>
</div>
<div>
</div>
<button type="submit">Add Tweet</button>
</table>
</form>
Now we are ready to add our tweet through the template. We perform validation for tweets just as we performed ...