Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On TypeScript for C# and .NET Core Developers

You're reading from   Hands-On TypeScript for C# and .NET Core Developers Transition from C# to TypeScript 3.1 and build applications with ASP.NET Core 2

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher
ISBN-13 9781789130287
Length 460 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Francesco Abbruzzese Francesco Abbruzzese
Author Profile Icon Francesco Abbruzzese
Francesco Abbruzzese
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Introduction to TypeScript FREE CHAPTER 2. Complex Types and Functions 3. DOM Manipulation 4. Using Classes and Interfaces 5. Generics 6. Namespaces and Modules 7. Bundling with WebPack 8. Building TypeScript Libraries 9. Decorators and Advanced ES6 Features 10. Angular ASP.NET Core Project Template 11. Input and Interactions 12. Angular Advanced Features 13. Navigation and Services 14. Assessments 15. Other Books You May Enjoy

Modules, components, and data binding

Previous sections, Project structure and Angular architecture, already described the basic structure of components. This section provides a few missing details and focuses on bindings and how to pass input to components.

As already discussed, components are made up of three parts: a TypeScript class decorated with the @Component decorator, an HTML template, and CSS styles. The TypeScript class has a leading role since the other two parts are specified as properties of the @Component class decorator together with the component tag name:

@Component({
selector: 'app-nav-menu',
templateUrl: './nav-menu.component.html',
styleUrls: ['./nav-menu.component.css']
})
export class NavMenuComponent {
isExpanded = false;

collapse() {
this.isExpanded = false;
}

toggle() {
this.isExpanded = !this.isExpanded;
}
}
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime