Is there a way to have a DTO.
So on my back-end part I have a pretty clear domains, e.g. Client.
class Client {
protected $firstName;
protected $lastName;
}
In fact it is a class, that contain specific properties. I want to have something similar on my front-end part. I want to be sure that the object came to a function is an instance of Client
and I can refer to specific Client properties.
Another question - is it an appropriate approach to organize AngularJS (1.5.9) application?. Would it decrease application performance?
P.S. I want to get something like this on my front-end part
function someFunc(client) {
if (!(client instanceof Client)) {
// handle error
}
// here I can refer to client.firstName or client.lastName and not get undefined, as long as it is a required Client properties
}
Thank you!