December 2016
Intermediate to advanced
841 pages
17h
English
The following example code shows some basic TypeScript usage. If you understand this code, you have enough knowledge for the next chapters. This example code creates an input box in which you can enter a name. When you click on the button, you will see a personalized greeting:
class Hello { private element: HTMLDivElement; private elementInput: HTMLInputElement; private elementText: HTMLDivElement; constructor(defaultName: string) { this.element = document.createElement("div"); this.elementInput = document.createElement("input"); this.elementText = document.createElement("div"); const elementButton = document.createElement("button"); elementButton.textContent = "Greet"; this.element.appendChild(this.elementInput); this.element.appendChild(elementButton); ...Read now
Unlock full access