concept class in category angular

This is an excerpt from Manning's book Getting MEAN with Mongo, Express, Angular, and Node.js 2ED.
Bootstrap offers a collection of elements and classes that you can use to create a sticky navigation bar that’s fixed to the top and collapses the options into a drop-down menu on mobile devices. We won’t explore the details of Bootstrap’s CSS classes here. All you need to do is grab the example code from the Bootstrap website, tweak it a little, and update it with the correct links.
A decorator is a way that ES2015 and TypeScript provide metadata and annotations to functions, modules and classes. A common use case in Angular is to handle dependency injection, which is a way of saying, “This module or class depends on this piece of functionality to run.”
This example is good and shows you the way forward, but you need a lot more data for a location and a better way to manage it. For this purpose, you need to use a class.
Listing 10.25. Defining, using, and exporting a class for reviews in locations.ts
export class Review { #1 author: string; rating: number; reviewText: string; } export class Location { _id: string; name: string; distance: number; address: string; rating: number; facilities: string[]; reviews: Review[]; #2 coords: number[]; openingTimes: OpeningTimes[]; }

This is an excerpt from Manning's book Angular Development with Typescript, Second Edition.
Each Angular component contains a template for UI rendering and a class implementing the component’s functionality.
To test Angular artifacts, you need to create and configure an Angular module for the class under test using the configureTestingModule() method of the TestBed utility, which allows you to declare modules, components, providers, and so on. For example, the syntax for configuring a testing module looks similar to configuring @NgModule(), as you can see in the following listing.

This is an excerpt from Manning's book Angular in Action.
Let’s start from the bottom and go from there. In ES2015, classes were introduced as a new way to define an object, which is in fact a function. Classes are used to create components, directives, pipes, and services, though they can be used in other ways as well. Using the
classkeyword, the classMyComponentis created and is an object that has a property calledtitle.Classes are syntactic sugar for creating objects in JavaScript. They don’t introduce a new type of inheritance to JavaScript, which is important to remember. Developers familiar with class objects in other languages may accidentally carry over concepts into JavaScript, but in this case the concept of a class doesn’t change the way prototypical inheritance works with JavaScript.
The
StocksServiceclass is exported and is decorated by theInjectabledecorator. The decorator is used to set up the proper wiring for Angular to know how to use it elsewhere, so if you forget to include the decorator, the class might not be injectable into your application.In the constructor method, the HttpClient service is injected using the TypeScript technique of declaring a private variable called
httpand then giving it a type of HttpClient. Angular can inspect the type definition and determine how to inject the requested object into the class. If you’re new to TypeScript, keep in mind that anytime you see a colon after a variable declaration, you’re defining the object type that should be assigned to that variable.