Two approaches to forms
Angular offers developers the ability to build feature-rich forms. Form capabilities alone can make using Angular a compelling choice. In the HTML world, a form is represented by the <form>
tag placed somewhere in the HTML code of a page. Here's a simple form, which uses bootstrap CSS for styling and captures the user input, such as email
and phone
:
<form class="form-inline"> <div class="form-group"> <input type="text" class="form-control" id="email" name="email" placeholder="Email"> </div> <div class="form-group"> <input type="text" class="form-control" id="phone" name="phone" placeholder="Phone"> </div> <button type="submit" class="btn btn-primary">Save</button> </form>
The form doesn't have the action
attribute defined, since it won't directly POST to a server. The two form inputs, email
and phone
, are submitted by clicking the Save
button. We could ignore...