Access modifiers

In the preceding example regarding decorators, we can also see the use of access modifiers (public and private). If the property is going to be used by any class that extends this class or if the property is going to be used in a template (in terms of Angular), then it should be marked as public; otherwise, it should have the access modifier marked as private.


If the access modifier is not added, like the cars property in CarsComponent in the preceding example, the default public access modifier is assigned to the property.

Now that we understand some basics of TypeScript, let's also get familiar with Angular CLI, a command-line interface tool developed by the Angular team to develop Angular applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.200.211