Skip to content

Commit

Permalink
Fix for #113: wrong model value updated when using Cleave.js in Angul…
Browse files Browse the repository at this point in the history
…ar with multiple fields.
  • Loading branch information
markleusink committed Sep 30, 2016
1 parent f27be55 commit 0e9ff33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cleave.angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ angular.module('cleave.js', [])
require: 'ngModel',

scope: {
cleave: '=',
cleave: '&',
onValueChange: '&?'
},

compile: function () {
return {
pre: function ($scope, $element, attrs, ngModelCtrl) {
$scope.cleave = new window.Cleave($element[0], $scope.cleave);
$scope.cleave = new window.Cleave($element[0], $scope.cleave() );

ngModelCtrl.$formatters.push(function (val) {
$scope.cleave.setRawValue(val ? val : '');
Expand Down

0 comments on commit 0e9ff33

Please sign in to comment.