Angular Flashcards

1
Q

What is the class that Angular provides to make http requests?

A

HttpClient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which is the packaga that contains the class HttpClient?

A

@angular/common/http

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which is the interface over HttpClient relies?

A

XMLHttpRequest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the basic building blocks of Angular?

A

Angular components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Angular NgModules?

A

NgModules contain Angular Components. They collect related code into functional sets. An application always has at least a root module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

They define views, which are sets of screen elements that Angular can choose among and modify according to your program logic and data

A

Components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

They can be injected into components as dependencies, making your code modular, reusable, and efficient.

A

Service Providers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are services?

A

They are for data or logic that isn’t associated with a specific view, and that you want to share across components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is injection decorator for?

A

The decorator provides the metadata that allows other providers to be injected as dependencies into your class. A service class definition is immediately preceded by the @Injectable() decorator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is Dependency injection (DI) for?

A

Dependency injection (DI) lets you keep your component classes lean and efficient. They don’t fetch data from the server, validate user input, or log directly to the console; they delegate such tasks to services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Que es un decorador?

A

Un decorador agrega metadata a un componente, como por ejemplo la plantilla que debe quedar asociada.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

List some Angular decorators

A

@Component()
@Directive()
@Pipe()
@Injectable()
@NgModule()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

List the forms of Angular Binding

A

Interpolation
Property binding
Event binding
Attribute binding
Class and style binding
Two-way data binding with ngModel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Cómo se inicia un proyecto Angular?

A

npm install -g @angular/cli
ng new <my-app></my-app>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Cómo se ejecuta un proyecto Angular?

A

Navegar hasta la carpeta de la aplicación
ejecutar: “ng serve - - open”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Que signfica el prefijo ng en las directivas Angular?

A

ng funciona cómo apreviatura para Angular, mas que quedo desde el punto de vista de la pronunciación. También pudo haber sido pensado como ng = new generation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Que elementos se configuran al usar “ng new”?

A

Angular routing
Style format como CSS, SCSS, SASS o LESS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Que es un Angular View?

A

Está definida por un componente y su plantilla.

19
Q

Donde estan ubicados los modulos?

A

En la carpeta node_modules

20
Q

Comando para compilar para producción

21
Q

Comando para ejecutar con pruebas

22
Q

Que significa PWA?

A

Progressive web application

23
Q

Que es Angular Material?

A

Es una biblioteca de componentes preconstruidos para trabajar interfaces de usuario con Angular.

24
Q

Cómo se agrega Angular Material a un proyecto?

A

ng add @angular/material

25
Que elementos adicionales componentes proporciona Angular Material?
Temas, tipografias y animaciones.
26
Cómo agregar archivos con variables de entorno en anuglar?
$ ng generate environments
27
De un ejemplo de template expressions

Current customer: {{ currentCustomer }}

28
De un ejemplo de template statements
29
Cómo se agrega un componente usando angular CLI?
ng generate component xyz
30
Cómo se configuran las rutas en Angular?
- $ ng generate component - Se deben agregar los nuevos componentes al elemento declarations en el archivo app.module.ts - Se deben agregar los paths al array de rutas en el archivo app-routing.module.ts
31
Cuales son los tres tipos de directivas?
# Attribute Directives - Component - Structural Directives - Attribute Directives
32
Mencione dos directivas estructurales comunes
*ngIf, *ngFor
33
De un ejemplo de el uso de la directiva *ngIf
@Component({ selector: ‘app-notification’, template:`
Show Notification
` }) export class AppNotificationComponent { showNotif = true; }
34
En que año sale Angular 2?
2016
35
De un ejemplo de el uso de una directiva de atributo
import { Directive, ElementRef } from '@angular/core'; @Directive({ selector: '[appHighlight]' }) export class HighlightDirective { constructor(private el: ElementRef) { this.el.nativeElement.style.backgroundColor = 'yellow'; } } /*************/

This is invalid

36
¿Cómo se crea un servicio?
ng generate service hero
37
Why services?
Components shouldn't fetch or save data directly and they certainly shouldn't knowingly present fake data. They should focus on presenting data and delegate data access to a service.
38
What is @input() decorator for?
It is for passing properties from parent to childs.
39
Show an example of @input() decorator use
import { Component, Input } from '@angular/core'; export class ItemDetailComponent { @Input() item = ''; } /* From parent */
40
How can we watch for changes on an @input() property?
We can watch them through OnChanges lifecycle hook.
41
What is @OutPut() decorator for?
The @Output() decorator in a child component or directive lets data flow from the child to the parent. To raise an event, an @Output() must have the type of EventEmitter
42
How can we specify a template variable?
In the template, you use the hash symbol, #, to declare a template variable
43
Give an example of template variable use
44
Mention some testing frameworks that could be used with Angular.
Jest, developed by FaceBook Mocha, developed by T. J. Holowaychuk, ExpressJS Developer Jasmin, BDD framework, developed by Pivotal Labs