When working with objects in javascript, and with the AngularJS framework, where should we write the object code?
For example, I'm going to create an object with something like this:
var LogMessage = function(system, type, message, value, now) {
this.system = system;
this.type = type;
this.message = message;
this.value = value;
this.time = now;
};
If I need to use it on several services or controllers, I would have to copy the code to all places, so should I create a js file that has all my objects?