RC0: TypeScript 'private' vs. 'public' keyword

Hey so just to add a bit to what Josh mentioned in the post.

In order for AoT compiler to work, it needs to map everything out ahead of time (get it?)

So when you set a property to private, AoT cannot access it. So it will introduce errors and you app will not run.

Since private/public accessors are a TS only concepts, they never really added anything to your app once it got compiled down. So it’s safe to keep everything as public.

6 Likes