Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="exemploApp">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <div ng-controller="ExemploCtrl as ctrl">
      <form>
        <p>
          <label>Nome:</label>
          <input type="text" ng-model="ctrl.nome">
        </p>
        <p>
          <label>Idade:</label>
          <input type="number" ng-model="ctrl.idade">
        </p>
        <button type="submit">Submit</button>
      </form>
      <div>
        <h3>Debug:</h3>
        <p>
          {{ctrl}}
        </p>
      </div>
    </div>
    <!-- AngularJS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.7/angular.min.js"></script>
    <script>
      angular.module('exemploApp', [])
        .controller('ExemploCtrl', function() {
          var ctrl = this;
          // Valores iniciais para os campos do formulário
          ctrl.nome = "";
          ctrl.idade = 18;
        })
      ;
    </script>
  </body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers