Skip to content

Instantly share code, notes, and snippets.

@ksheedlo
Created February 16, 2015 18:50
Show Gist options
  • Save ksheedlo/67db89421a1bd221adbd to your computer and use it in GitHub Desktop.
Save ksheedlo/67db89421a1bd221adbd to your computer and use it in GitHub Desktop.
'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