Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <script src="//code.angularjs.org/snapshot/angular.js"></script>
    <script src="//code.angularjs.org/snapshot/angular-animate.js"></script>
    <meta charset="utf-8">
    <title>JS Bin</title>
  </head>
  <body ng-app="app">
    <h1>Form</h1>
    <form name="myForm">
      <input type="email" id="input" ng-model="emailAddress" name="myEmail" />
    </form>
    <h1>NgModelController</h1>
    <pre>{{myForm.myEmail | json}}</pre>
    <h1>Input className</h1>
    <div show-class="#input"></div>
  </body>
</html>
 
var app = angular.module('app', ['ngAnimate']);
app.directive('showClass', function() {
  return {
    restrict: 'A',
    template: '<pre>{{classes}}</pre>',
    link: function(scope, elem, attrs) {
      var el = document.querySelector(attrs.showClass);
      setInterval(function() {
        if (el.className !== scope.classes) {
          scope.classes = el.className;
          scope.$apply();
        }
      }, 300);
    }
  };
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
sravenhorstpro
0viewers