Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

get and set in typescript

class ABC {
    private Name: string;

    get name() : string {
        return this.Name;
    }

    set name(setName: string){
        this.Name = setName;
    }
}

let abc = new ABC();
abc.name = "Albert Thomas"; //set property
console.log('My name is ' + abc.name); //get property
Comment

PREVIOUS NEXT
Code Example
Typescript :: typescript react theme-provider 
Typescript :: typescript class extends 
Typescript :: does any event get triggered when checked value changes programatically? 
Typescript :: in grunt cannot be loaded because running scripts is disabled on this system 
Typescript :: ipywidgets hide widget 
Typescript :: pandas get count of pair of elements in two columns 
Typescript :: intrinsicattributes typescript 
Typescript :: angular start date end date validation 
Typescript :: formgroup check if valid 
Typescript :: format time to am pm 
Typescript :: onSubmit for form in antd 
Typescript :: parse object typescript 
Typescript :: Start Angular App In Localhost 
Typescript :: order documents in firestore 
Typescript :: loop trhough list of lists in python and find single elements 
Typescript :: python compare lists unordered 
Typescript :: ts builder pattern 
Typescript :: ts compile command 
Typescript :: typescript generic type 
Typescript :: declare type function typescript 
Typescript :: obsidian write file 
Typescript :: apexcharts marker onclick 
Typescript :: curl -s "http://google.com?[1-1000]" 
Typescript :: coding and testing is done in following manner 
Typescript :: file attachements contac form 7 
Typescript :: export data in Documents outside sandbox in swift 
Typescript :: how to get both key and value of enum in typescript 
Typescript :: android java loop through all objects in layout 
Typescript :: TypeError: __cinit__() takes at least 2 positional arguments (0 given) 
Typescript :: typescript inline switch 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =