Created
September 23, 2015 08:06
-
-
Save simon04/303f6b188a9d303215b9 to your computer and use it in GitHub Desktop.
Angular: modify locale NUMBER_FORMATS for numberFilter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/angular/angular.js/pull/9160#issuecomment-68950547 | |
// http://plnkr.co/edit/qvzXkQkVtTLHvHVYXTdU?p=preview | |
angular.module('foo', []).config(config); | |
function config($provide) { | |
$provide.decorator('numberFilter', function($delegate) { | |
$delegate.$stateful = true; | |
return $delegate; | |
}); | |
$provide.decorator('$locale', function($delegate) { | |
$delegate.NUMBER_FORMATS.GROUP_SEP = ' '; | |
$delegate.NUMBER_FORMATS.PATTERNS.map(function(pattern) { | |
pattern.gSize = '4'; | |
pattern.lgSize = '4'; | |
}); | |
return $delegate; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment