3
When we work with objects in javascript, and with the Angularjs framework, where we write the code of the objects?
For example, I’m going to create an object that looks 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 in several services or controllers, I would have to copy the code everywhere, so I should create a js file that has all my objects ?
Julyano, this answer is more of a comment than a response. If you don’t have a concrete example of how to use these objects inside the Angular I suggest leaving only as a comment. If you want to [Edit] and improve, excellent :)
– Sergio