Difference between interfaces and classes in Typescript

Discussão em 'Angular' iniciado por Emre Öztürk, Novembro 23, 2024.

  1. What is the different between Typescript Interfaces and Classes? When do I use a Class? When do I use Interfaces? What are the advantages of them?

    I need to create some kind of types for an http-request to my backend server (Doing it with Angular 2), like : },

    "fields": {
    "project": {
    "id": "10000"
    },
    "summary": "something's wrong",
    "issuetype": {
    "id": "10000"
    },
    "assignee": { // not neccesary required
    "name": "homer"
    },
    "reporter": {
    "name": "smithers"
    },
    "priority": { // not neccesary required
    "id": "20000"
    }
    }


    What should I use for building these models? Thank you!

    Continue reading...

Compartilhe esta Página