Skip to content

Instantly share code, notes, and snippets.

@Charuru
Created June 5, 2013 04:15
Show Gist options
  • Save Charuru/5711562 to your computer and use it in GitHub Desktop.
Save Charuru/5711562 to your computer and use it in GitHub Desktop.
.directive('formMultiple', function() {
return {
scope: {
formMultiple: '=',
},
link: function(scope, elm, attr) {
$(elm).on('keydown', 'input', function() {
if( $(elm).find('input:last').val() != '') {
scope.formMultiple.push(scope.formMultipleDefault)
scope.$digest()
}
});
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment