Ember Utility class for accessing data across different places


#1

I want a Utility class in Ember which does the following, takes in rowItems and returns an object (finalMeta)

var myMeta1 = new Array();
var myMeta2 = new Array();

dojo.forEach(rowItems, dojo.hitch(this, function(rowItem){
	
	var metaData = {
			Id: rowItem.Id,
			version: rowItem.version
	};
	
	if(rowItem.tranMetaData.template){
		myMeta2.push(metaData);
	}else{
		myMeta1.push(metaData);
	}
}));

if(myMeta1.length == 0){
	myMeta1 = null;
}

if(myMeta2.length == 0){
	myMeta2 =  null;
}

var finalMeta = {
	"myMeta1": myMeta1,
	"myMeta2": myMeta2
};

return finalMeta;

Where/How do I write this Utility class, such that it can be accessed from a different place (say from a different route)