Week 8 Angular Study Guide Flashcards
What is a framework?
A framework is a platform for developing software applications. It provides a foundation on which software developers can build programs for a specific platform. A framework may also include code libraries, a compiler, and other programs used in the software development process.
What is Angular?
It is an open-source TypScript-based frontend framework developed by Google (in 2010).
It uses a component structure that represents a view on a webpage
We use Angular to create SPA’s (Single Page Applications)
- SPA’s allow for faster and more responsive web pages and a better user-experience
What makes and Angular app?
TypeScript framework developed and maintained by Google.
Reusbale code through the inclusion of modules Dynamics views through the usage of components and templates DOM manipulation is handled through Directives Single-page applications are created through the use of Routing Handle Dependency Injection through the use of Services
What is TypeScript?
it is open-source and invented & maintained by Microsoft
it is a super-set of JS it is strictly typed Browsers themselves cannot interpret TS, so it must be transpiled into JS. It has syntax closer to higher level languages like Java, and a compiler, therfore it gives us compilation errors.
What is Node JS?
It is a JS interpreter/server environment that allows us to run JS outside of the browser.
What is NPM? What does it stand for?
NPM = Node Package Manager
It is included in the download of Node.js and consists of a CLI (Command Line Interface) that interacts with a remote registry
Similar to maven, it can manage dependencies and versions
- This is done through the package.json file (which acts like the pom.xml).
What is Angular CLI?
Angular CLI (Command Line Interface) is the CLI that is used to scaffold and build the Angular Project using module.
What is the Angular command for the CLI?
ng is the Angular command for the CLI
How do you install Angular?
to install Angualar, we call npm install -g @angular/cli
What is Webpack? What does it do?
The angular CLI uses a tool called webpack which is a build automation tool.
it minifies all of our JS scripts, HTML and CSS files and bundles them together
The webpack traverses our application looking for import statements and builds a dependency graph
What can you compare package.json to? Where is it stored? What is it for?
Think of the pom.xml file within your Angular project
The package.json file is stored in the root of your application This file is used to give information to npm (node package manager) and identify all the project's dependencies and handle them.
What are Angular components?
Components are the most basic block of an Angular app. An Angular App contains a tree of Angular Components
What is the full structure of a component?
mycmp.component.css – the component’s private styling sheet
mycmp.component.html -- HTML Template mycmp.component.ts -- Here we define the module, its properties, lifehooks, etc. mycmp.component.spec.ts -- unit testing file
How do you create a component?
To create a component run: ng g c mycomponent
Where are changes added to after creating a component? What method is created?
As soon as we create a component, all changes are added to our app.module.ts file
As soon as the component is created, ngOnInit method is created
- this method is called by default when the class is executed.
It also has a constructor
the app component is the Parent component and any new components that we create and the Child components