Angular Flashcards
What is Angular
Angular is a structural framework for dynamic web apps. A framework for building single-page applications (SPA) using HTML and TypeScript.
What makes a SPA different from a normal web page?
A Single Page Application is faster, more responsive and has an overall better user experience. It has caching/loading for all parts of the SPA. However, it is less secure from cross scripting and not optimal for search engines.
What are some features of the Angular framework
Typescript, dependency injection, directives, component structure.
How does TypeScript relate to JavaScript?
TS is a superset of JS, meaning that all JS will run in TS. TS is strictly typed and shows syntactical errors. It is also a higher level language closer to Java.
What are some of the data types of TypeScript?
number, string, boolean, enum, void, null, undefined, any, never, Array and tuple.
How do you create a new Angular Project? What are some other commands for the Angular CLI?
ng new
ng generate component or ng g c
ng g service, guard, interceptor
ng serve or ng serve -o(pen)
What is a component and what files make it?
A component is what controls a patch of screen called a view.
app. component.css - holds all the CSS styles
app. component.html - this template contains typical HTML elements and alters the HTML based on our app’s logic and DOM manipulations.
app. component.ts - contains typescript code to control the component behavior.
app. component.spec.ts - is for testing
What is the npm and what does it do?
The node package manager, manages the dependencies and versions for the project. similar to Maven. The npm uses the package.json to manage the dependencies and places the libraries from the dependencies in the node_modulus folder, which is typically left out of a bundled project.
What are decorators in Angular and what are some?
Decorators are a design pattern that is used to separate modification or decoration of a class without modifying the original source code. functions that allow a service, directive or filter to be modified prior to its usage.