framework Flashcards

1
Q

to export (make it public available) a module:

A

thatfile.js
export default{ foo:’hello’ }

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

to import a module:

A

thisfile.js:
import thatfile from ‘./thatfile’
console.log(b.foo);

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

Problems with ES2015 Modules

A

Duplicate Modules
Circular Dependency
Harder to manage overall

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

Angular Modules

A

not a replacement for ES2015 Modules
groups modules by feature

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

Angular Module in the right way

A

A module is imported once and then all the connected modules has its content available

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

it is a common practice to organice our modules in forlders

A

The name of the file is the name of the module along with the “.module.ts” string

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

A module is a type of

A

Class

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

import NgModule module and add the decorator

A

to declare the class as a module

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

Import BrowserModule

A

to tell Angular to run the app in a browser enviroment

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

A module allow us to wrapp many dependencies in to one module/file

A

so that this could be easily imported into others modules

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

Component

A

Reusable custom HTML tag with custom behaviour

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

A component renders

A

into a tag inner the DOM

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

Selector name should be

A

lowercase with only dashes to separte the words

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

‘app-root’ component

A

default component (tag or selector) to bootstrap an angular app

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

The template section is

A

valid html

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

A component also import a module and apply a decorator

A

to be consistent with the DOM

17
Q

template-url:

A

instead of “template:” for inline html code

18
Q

StyleUrls:[]

A

to add CSS files instead of “style:” to add embedded css rules

19
Q

We declare (Import) the app component

A

that allow us to render components

20
Q

We declare services (external data access)

A

like providers

21
Q

We only declare the component module

A

to bootstrap the application

22
Q

create a component through NG

A

ng generate component component_name

// it creates a folder, with a css, a html, test and an angular file with that name
// it registers it into the module file

23
Q

to initialize the properties of a component

A

constructor(){}

24
Q

To allow a parent component to modify the content of an specific property inner a component

A

// 1. Import “Input” from “@angular/core”
// 2. Add @Input() decorator before the declaration of out property

25
Q

component nesting

A

it is allowed as long as all them are accesible

26
Q

property binding over a component (Custom properties)

A

[app-root [propertyName]=”defaultValue”] [/app-root]

  • square brackets used instead of tag brackets
27
Q

parent components can send data to child components

A

through Input properties

28
Q

to communicate a child component with its parent component we use

A

events emitting

29
Q

to declare an event emitter

A

// 1. Import “EventEmitter” from “@angular/core”
// 2. declare the property in this way:
propertyName = new EventEmitter()