Skip to content

Commit

Permalink
updated the project for 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jstroem committed Jan 20, 2017
1 parent e970961 commit 4c60dd5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
<input ng-model="demo.value" type="text">
</label>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.4.7/angular-locale_en-gb.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.6.1/angular-locale_en-gb.js"></script>

<script src="../dist/ng-input-currency.js"></script>
<script>
Expand Down
12 changes: 8 additions & 4 deletions dist/ng-input-currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ angular.module('ngInputCurrency').service('ngInputCurrencyService', ['$locale',
angular.module('ngInputCurrency').directive('ngInputCurrency', ['$locale','$filter','ngInputCurrencyService','$timeout', function($locale, $filter, util, $timeout) {
var link = function($scope, $element, $attrs, $ngModel){

$ngModel.$options = {
updateOn: 'blur enter',
updateOnDefault: false
}
var opts = {
updateOn: 'blur enter',
updateOnDefault: false
};
if ($ngModel.options !== null)
opts = $ngModel.$options.createChild(opts);

$ngModel.$options = opts;

var filter = $filter('currency');
$ngModel.$formatters.push(function fromModelToView(value) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
},
"homepage": "https://github.com/jstroem/ng-input-currency",
"devDependencies": {
"angular": "^1.5.4",
"angular-i18n": "^1.5.4",
"angular-mocks": "^1.5.5",
"angular": "^1.6.1",
"angular-i18n": "^1.6.1",
"angular-mocks": "^1.6.1",
"bower": "^1.5.2",
"gulp": "^3.9.0",
"gulp-browserify": "^0.5.1",
Expand Down
12 changes: 8 additions & 4 deletions src/ng-input-currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ angular.module('ngInputCurrency').service('ngInputCurrencyService', ['$locale',
angular.module('ngInputCurrency').directive('ngInputCurrency', ['$locale','$filter','ngInputCurrencyService','$timeout', function($locale, $filter, util, $timeout) {
var link = function($scope, $element, $attrs, $ngModel){

$ngModel.$options = {
updateOn: 'blur enter',
updateOnDefault: false
}
var opts = {
updateOn: 'blur enter',
updateOnDefault: false
};
if ($ngModel.options !== null)

This comment has been minimized.

Copy link
@aspcanada

aspcanada Jan 20, 2017

Contributor

You got a bug here! needs to be $options

This comment has been minimized.

Copy link
@jstroem

jstroem Jan 20, 2017

Author Owner

Thanks!

opts = $ngModel.$options.createChild(opts);

$ngModel.$options = opts;

var filter = $filter('currency');
$ngModel.$formatters.push(function fromModelToView(value) {
Expand Down

0 comments on commit 4c60dd5

Please sign in to comment.