TypeScript – Access Modifiers and Properties

There are two access modifiers (public and private), which control the accessibility of the properties of a class.

Default setting is public, for example :

class user {
    userId: number;
    public userName: string;
    private address: string;
}

“userId" and “userName" are public and “address" is private.

TypeScript – Access Modifiers and Properties

對「TypeScript – Access Modifiers and Properties」的想法

  1. I’ve been browsing online more than 2 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my opinion, if all webmasters
    and bloggers made good content as you did, the web will be much more useful than ever
    before.

    按讚數

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s