AngularJS – Create a directive that uses ng-model
EDIT: This answer is old and likely out of date. Just a heads up so it doesn’t lead folks astray. I no longer use Angular so I’m not in a good position to make improvements. It’s actually pretty good logic but you can simplify things a bit. Directive var app = angular.module(‘plunker’, []); app.controller(‘MainCtrl’, function($scope) … Read more