Week 8 - Angular Flashcards
What is Angular?
Angular is a Typescript based, open-source, front-end web app framework
Are AngularJS and Angular the same?
No. Angular is a complete rewrite of AngularJS.
AngularJS is based on Javascript, while Angular utilized Typescript which transcribes into Javascript.
What 3 technologies would you include in your environment to create an Angular app?
- node.js - a JS runtime built on Chrome’s V8 JS engine
- Node Package Manager (npm) - default package manager for node.js
- Angular CLI - command line interface used to structure and build Angular apps
What is Angular CLI?
a command line interface used to structure and build Angular apps using node.js style modules. It also handles many common tasks for you, such as generating directives, services, and components.
What CLI command would you use tocreate an Angular project using the Angular CLI?
ng new (project name)
What is the folder structure of an Angular app created by the Angular CLI?
o E2E – The end to end test folder mainly used for integration testing
o Node modules- where Node Package manager packages are installed
o SRC- contains all of the files for the actual Angular project
Where is the app folder located?
within the project’s src folder
What file does the app folder contain if the project is created by the Angular CLI? (4)
- app.module.ts – contains the references to different libraries used within the project
- app.component.css - contains the CSS structure for the component
- app.component.html – contains the html template for the component
- app.component.ts – contains the class for the component. Holds the logic to manage the functionality of the component
What is a decorator?
- a special kind of declaration that can be attached to a class declaratio, method, accessor, property, or parameter.
- functions that are called at declaration
- look a lot like annotations and are used to mold metadata in Angular
What is a module?
- in JS and TS (typescript), modules refer to small units of independent reusable code. when you use the keyword export on a class, it becomes a module for another file to import later.
What is @ngModule?
- a decorator used to create a module.
- it configures the injector and the compiler, and helps organize related things together
What are some attributes inside the @ngModule? (4)
- declarations - stores the references for components
- imports - stores the references to store modules
- providers - stores the references to the services created
- bootstrap - has the references to the default component created; the bootstrapped component is created and inserted in the browser DOM
What is bootstrapping?
the first piece of code that is loaded; in the case of Angular, we have to tell it which component is the starting point for our app
What is a component?
- the fundamental building blocks of our app
- Angular documentation - a component controls a patch of the screen real estate that we could call a view, and declares