Angular 2 Flashcards
1
Q
4 key building blocks of angular 2 apps
A
Components
Directives
Routers
Services
2
Q
Component
A
- Encapsulates the template, data, and behavior of a view (view component)
- Every app will have AT LEAST root component
- Are reusable
- Typescript/JavaScript class
- Do not need to reference the DOM
- Is bound to element
3
Q
Service
A
- Provide specific functionality not directly related to views
- Injected into components as dependencies
- Any logic not related to ‘view’
- Any non UI logic
- ex. talking to backend APIs
- Data access, logging, business logic, configuration
4
Q
Router
A
- Only responsible for navigation
- Defines navigation paths
- Maps URL-like paths to views instead of pages
5
Q
Directive
A
- To modify DOM elements and/or extend their behavior
- keywords added to DOM elements
6
Q
ng new
A
- Creates workspace and initial application
- CLI installs necessary npm packages
- creates skeleton
7
Q
What is Angular?
A
A platform and framework for building single-page client applications using HTMl and TypeScript
8
Q
NgModules
A
- a class @NgModule
- takes a metadata object that describes how to compile a component’s template and how to create an injector at runtime
- Help organize related things together
9
Q
Views
A
- Sets of screen elements that Angular can choose amongh and modify according to program login and data
- arranged hierarchically
10
Q
decorators
A
- Used by module, component and service classes
- functions that modify JavaScript classes
- Angular defines some that attach specific kinds of metadata to classes (tells system what those classes mean and how they should work)
11
Q
AppModule (root module)
A
- Present in every Angular app
- provides bootstrap mechanism
12
Q
workspace
A
- contains the files for one or more projects
13
Q
project
A
- set of files that comprise as standalone application or shareable library
14
Q
attribute directive
A
changes the appearance of behavior of a DOM element
15
Q
ng generate directive DIRECTIVE_NAME
A
instantiates the directive to your src/app