Skip to content

Instantly share code, notes, and snippets.

@mheap
Created January 9, 2017 10:05
Show Gist options
  • Save mheap/058820419fcc8a53dfaa5222df7f86a5 to your computer and use it in GitHub Desktop.
Save mheap/058820419fcc8a53dfaa5222df7f86a5 to your computer and use it in GitHub Desktop.

Revisions

  1. mheap created this gist Jan 9, 2017.
    11 changes: 11 additions & 0 deletions WithAccessor.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    class Foo {
    private _bar: string;

    public get bar(){
    return this._bar;
    }

    public set bar(v: string){
    this._bar = v;
    }
    }
    3 changes: 3 additions & 0 deletions WithoutAccessor.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    class Foo {
    public bar: string;
    }