Rainer is a passionate software developer and loves to work with Angular and Spring. He is a trainer and consultant at AngularArchitects.io and runs ng-news, a weekly Angular newsletter.
Hi Alexandr, thanks for mentioning but I did this on purpose to enforce encapsulation. So I don't want that anybody can access the author property except the object itself.
I am using this in prototype-based version at the end of this article and mentioned the problem with encapsulation.
Rainer is a passionate software developer and loves to work with Angular and Spring. He is a trainer and consultant at AngularArchitects.io and runs ng-news, a weekly Angular newsletter.
Nice article!
But it seems you've got a mistake in this code block:
it should be like:
Hi Alexandr, thanks for mentioning but I did this on purpose to enforce encapsulation. So I don't want that anybody can access the
author
property except the object itself.I am using
this
in prototype-based version at the end of this article and mentioned the problem with encapsulation.Still, it's entirely useless, you should add a getter or something to avoid confusing people :)
True, have added a getter method. Thanks for the input to both of you!
You're right in this case
sry :]