General Flashcards
Four elements of an angular app
components, directives, routers, services
Which element of angular encapsulates the template, data and the behaviour of a view?
Component. A component can be thought of as a “view” component.
Suggest an advantage of angular components being decoupled from the DOM
An advantage of having components decoupled from the DOM is that they are unit testable.
Which element of angular is used to modify the DOM and extend the behaviour of DOM elements?
Directives.
What is a .js.map file for?
Maps the JS code to it’s corresponding TS code in debugging.
What did typescript namespaces used to be called?
Internal modules
In angular what is the equivalent of a java annotation or a c# attribute?
Decorator
Translate the following code to English
import {Component} from ‘angular2/core’
Import the Component decorator from the angular2/core module
What type of code element is a decorator
A function
Create an <li> that iterates through an array of courses</li>
<li>{{ course }}</li>
Is a component a service, template or directive?
Directive
declare a button with a click handler that adds a server
Add Server
Declare an input with a 2-way binding to a first name property.
Declare a stop button that is enabled when the running property is true.
Stop
What does an asterisk mean in Angular
An asterisk prefix denotes a structural directive.