-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The TypeScript Workshop
By :

So far, you've been decorating classes and methods. These are basically pieces of code that get executed, and you have been able to change and augment the code that got executed. But your code consists not only of "active," live code, but of other definitions as well – in particular, your classes have fields, and your methods have parameters. In the activity before this section, you were able to detect whenever the title
property was accessed because you had a method that was getting the value, and a method that was setting the value – so you piggybacked your code to the already existing "active" code. But how do you decorate the "passive" parts of your program? You cannot attach code that runs when your "passive" code gets executed, because frankly there's nothing to execute in public firstName: string
. It's a simple definition.
You cannot attach any code that gets executed for your...