Created
February 16, 2015 18:50
-
-
Save ksheedlo/67db89421a1bd221adbd to your computer and use it in GitHub Desktop.
This file contains 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
'use strict'; | |
// ksheedlo: I'm working on a node/web micro library for this, but it's not published yet | |
angular.module('myApp') | |
.factory('Types', function () { | |
return { | |
toInt: function (x) { | |
return parseInt(x, 10); | |
}, | |
toFloating: function (x) { | |
return +x; | |
}, | |
toBoolean: function (x) { | |
return !!x; | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment