1 define([ 'app/cpeui/cpeui.module' ], function(cpeui) {
3 Array.prototype.filterByField = function(field_name, value, to_filter_out) {
4 if (to_filter_out == undefined) {
7 return this.filter(function(item) {
8 return (item[field_name] == value) != to_filter_out;
12 cpeui.factory('Utils', function() {
15 svc.randomId = function () {
16 return Math.floor(Math.random() * Math.pow(2, 31));