Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <body ng-app="app">
  <form name="exampleForm" class="elegant-aero">
    <label>First Name:</label>
    <input type="text" name="userFirstName" ng-model="firstName" required />
    <div ng-messages="exampleForm.userFirstName.$error">
      <div ng-message="required">This field is required</div>

    <label>Last Name:</label>
    <input type="text" name="userLastName" ng-model="lastName" required />
    <div ng-messages="exampleForm.userLastName.$error">
      <div ng-message="required">This field is required</div>

    <label>Email Address:</label>
    <input type="email" name="userEmail" ng-model="email" required />
    <div ng-messages="exampleForm.userEmail.$error">
      <div ng-message="required">This field is required</div>
      <div ng-message="email">Your email address is invalid</div>

    <label>Phone Number:</label>
    <input type="email" name="userPhoneNumber" ng-model="phoneNumber" ng-pattern="/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/" required/>
    <div ng-messages="exampleForm.userPhoneNumber.$error">
      <div ng-message="required">This field is required</div>
      <div ng-message="pattern">Must be a valid 10 digit phone number</div>

    <label>User Message:</label>
    <textarea type="text" name="userMessage" class="form-control" rows="4" ng-model="message" ng-minlength="10" ng-maxlength="100" required></textarea>
    <div ng-messages="exampleForm.userMessage.$error">
      <div ng-message="required">This field is required</div>
      <div ng-message="minlength">Message must be over 10 characters</div>
      <div ng-message="maxlength">Message must not exceed 100 characters</div>



.elegant-aero {
  margin-top: 25px;
  max-width: 600px;
  background: #D2E9FF;
  padding: 20px 20px 20px 20px;
  font: 12px Arial, Helvetica, sans-serif;
  color: #666;

.elegant-aero label {
  display: block;
  margin: 0px 0px 5px;

.elegant-aero input[type="text"], .elegant-aero input[type="email"], .elegant-aero textarea {
  color: #888;
  width: 60%;
  padding: 0px 0px 0px 5px;
  border: 1px solid #C5E2FF;
  background: #FBFBFB;
  outline: 0;
  -webkit-box-shadow:inset 0px 1px 6px #ECF3F5;
  box-shadow: inset 0px 1px 6px #ECF3F5;
  font: 200 12px/25px Arial, Helvetica, sans-serif;
  height: 30px;
  margin: 2px 6px 16px 0px;

.elegant-aero textarea{
  padding: 5px 0px 0px 5px;
  width: 60%;

  color: red;
  margin-top: 5px;


                var app = angular.module('app', ['ngMessages']);