AngularJS 1.2.0rc1 Click Example

Shows how AngularJS 1.2.0rc1 requires only one pass for a directive with two way binding to update a scope variable.

by justbn

HTML

<body ng-app="app" ng-controller='AppCtrl'>

<form name="signup">
    <input type="text" name="firstname" id="firstname" placeholder="First Name Please" 
    required ng-model="firstname" ng-minlength="3" ng-maxlength="50" 
    ng-class="{'error': !signup.firstname.$dirty }>
</form>    
    
</body>

JavaScript

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

app.controller('AppCtrl', [ '$scope', function($scope) {
}]);