Fudamentals Flashcards
What and where is the Angular.json file?
A json file at the root level of the Angular workspace, provides project specific and workspace configuration details.
Such as path details for styles, scripts and assets.
And config for build and development tools by the CLI (e.g. serve.
A per-project config section and a few workspace properties
What is the purpose of the package.json file?
Configures the npm package (node) dependencies that are available for all projects in the workspace
What are NPM packages?
A package in Node.js contains the files you need for a module.
What is Node.js?
Node.js is an open-source server environment.
Allows you to run JavaScript on the server
What is the function of package-lock.json file?
Provides version information for all packages installed into node_modules by the npm client
What is the function of package-lock.json?
Provides version information for all packages installed in node_modules by the npm client
What is the function of the node_modules?
NPM packages are installed here and is accessible to the entire workspace.
The dependencies here will be visible to all projects (if its workspace wide)
In terms of programming, how does Node.js perform?
Node.js runs single-threaded, non-blocking, asynchronous programming
What is NPM?
NPM is a package manager for Node.js packages (and can be used for modules as well)
It is installed with Node.js
Consists of three main components:
-the website
-the CLI (command line interface)
-the registry
What is the public NPM registry?
A database of JavaScript packages.
It is used by developers to contribute & distribute their packages to communities (or local to their organisation) and also install others.
How do you use NPM?
Can be run via CLI with commands in a terminal.
‘npm …’
What is NVM?
And what is it used for?
Node Version Manager, a tool for (surprise) managing Node versions on your device.
Different projects on your device might be using different NPM versions, so can be provide version compatibility
What does the index.html file do?
The common name for the default page shown for a website (if no other page is specified)
Appropriately named as it serves an index to the main pages of the site
What is bootstrapping?
Bootstrapping is the process of initialising or loading the Angular application
What are the main steps in Bootstrapping?
- Load the Index.html file as the starting point for the app
- Loads Angular and third-party libraries/applications
- Executes the main.ts file as the application entry point (or as defined in the angular.json file for that project)
- Calls the bootstrapModule function to load and execute the Root module (app.module.ts)
- Executes the Root Component/s (example: app.component.ts) as defined in the Root Module in the bootstrap array. Sometimes called the Entry Components (not to be confused with the deprecated way to bootstrap)
- Display the Root Module Template (if called in the index.html)
What does the main.ts file do?
The file acts as the main entry point of the application, which is defined in the angular.json file.
It creates the browser environment with
‘Import {platformBrowserDynamic} from ‘@angular/platform-browser-dynamic’
And calls the bootStrapModule function to tell the builder to bootstrap the app:
‘platformBrowserDynamic().boostrapModule(AppModule)’