Introduction Flashcards
What is Angular?
Angular is a TypeScript-based open-source web application framework developed by the Angular Team at Google
What is TypeScript?
It is an open-source programming language on top of JavaScript to support static typing and other functionalities.
What is JavaScript?
– High-level, multi-paradigm (OO, functional) programming language
– Alongside HTML and CSS, JavaScript is one of the core technologies of the Web
– Initially only implemented client-side in web browsers, but JavaScript is now available server-side, in mobile and desktop apps too
- Dynamically and weakly typed
What are the main building blocks of an Angular application?
Modules, Components and Services
What are some of the technologies you might include in your environment to create an Angular application?
NodeJS
npm
Angular CLI
What is the Angular CLI?
It is a Command-line interface tool that you use to develop Angular applications
What is Node.js?
- Node.js is an open-source JavaScript runtime environment that executes JavaScript code outside of a browser (It allows for servers to be written using JavaScript)
What is npm?
– Node Package Manager – package (dependency) manager for Node.js packages
What is AJAX?
- Asynchronous JavaScript and XML
- Allows web pages to be updated asynchronously by exchanging data with a web server
- Transports data in XML, plain text, or JSON format (JSON is the most widespread nowadays)
What are directives in Angular?
- Directives are basically function calls in the HTML template
- There are three types: Component, Structural and Attribute
What is the use of @Input and @Output?
- They are used for communication between Angular Components, which are in Parent-Child Relationship
- Both of them are used in the Child Component
- We use @Input when we are passing data from the parent to the child component and @Output when we emit an event from the Child that the parent can subscribe to
What is Dependency Injection in Angular?
When a component is dependent on another component the dependency is injected/provided during runtime by Angular’s built-in dependency injection system
In what ways can a component (.ts) and a template (.html) file communicate with each other?
- interpolation: {{}}
- property binding: []
- event binding: ()
- two-way binding: [()]
What are observables?
An observable is a data source that publishes (emits) data changes.
Observers (consumers) subscribe to know whenever the data changes.
How do components exchange information if they are not in a parent/child relationship?
Through Services and Subjects (a special type of observable)
What do the built-in HttpClient’s requests return?
- An observable that the components can subscribe to
- The HTTP request is not sent until a component subscribes to the returned observable
What different form-building approaches are there in Angular?
- Template-driven approach - easier to use but not as configurable
- Reactive approach - a bit more code but a lot more control over the developer
What are lifecycle hooks in Angular?
- Directive and component instances have a lifecycle as Angular creates, updates, and destroys them
- Developers can interfere at key moments in that lifecycle by implementing one or more of the lifecycle hook interfaces
- There are 8 lifecycle hooks:
ngOnChanges()
ngOnInit()
ngDoCheck()
ngAfterContentInit()
ngAfterContentChecked()
ngAfterViewInit()
ngAfterViewChecked()
ngonDestroy()
What are the major features of Angular?
declarative templates, dependency injection, end-to-end tooling