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

app.controller('MainCtrl', function($scope) {
  $ = 'World';
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>AngularJs Validation using ng-Messages</title>
  <link rel="stylesheet" href="">

  <script src="//"></script>
  <script src="//"></script>
    var app = angular.module('app', ['ngMessages']);

    app.controller('MainCtrl', ["$scope", function($scope) {
      $ = '';

<body class="container" ng-app="app" ng-controller="MainCtrl">

  <div class="well text-center">
    <h2>AngularJs Validation using ng-Messages</h2>

  <form name="form">
    <div class="form-group" ng-class="{'has-error':$touched &&$invalid }">
      Email <input type="email" name="email" class="form-control" ng-model="email" required>
      <div class="help-block" ng-messages="$error" ng-if="$touched">
        <div ng-messages-include="msg.html"></div>

    <div class="form-group">
      <button type="submit" class="btn btn-danger">Submit</button>


  <pre>$error = {{$error | json }}</pre>
  <div class="well text-center">
    <p><a href="">By Anil Singh</a></p>

/* Put your css in here */

<p ng-message="required">This field is required</p>
<p ng-message="email">This needs to be a valid email</p>