I have this service:
我有这项服务:
app.factory('utilityService', [
'$http',
'$angularCacheFactory',
utilityService
]);
function utilityService(
$http,
$angularCacheFactory
) {
var factory = {};
factory.rowClicked = function ($index, collection) {
var row = collection[$index];
if (row.current) {
row.current = false;
return null;
} else {
collection.forEach(function (object) {
object.current = false;
});
row.current = true;
return $index;
}
};
factory.isArrayAndNotEmpty = function (theArray) {
var rc = typeof theArray !== 'undefined' && theArray.length > 0;
return rc;
};
return factory;
}
app.factory('u