Angular 2+ Flashcards
What is name of a special function of class which gets called when object is created and it’s syntax in Typescript?
constructor — constructor(){}
What are the basic rules of Decorators?
a function which has annotation of @() with optional parameters
If you do not know the number of arguments to be passed to function in advance, you should use _______ parameter type.
Rest parameter
_____ keyword is used to access class’s member variables and functions inside class member function.
this
In Angular, you can pass data from parent component to child component using
@Input()
In Angular, you can pass data from child component to parent component using
@Output()
Write a syntax for ngFor with <li> example.</li>
<li>
{{item}}
</li>
We must import ____________ module to use [(ngModel)].
FormsModule
Import ____________ module to use reactive form.
ReactiveFormsModule
Write an example to define custom event with Boolean argument with code and passing data to parent component.
objEvent = new EventEmitter();
Write a syntax to bind custom CSS class (e.g. highlighted) to a <div> tag.</div>
<div></div>
You can create local HTML reference of HTML tag using variable which starts with character
#
You can access HTML local reference alias in component’s typescript code using ___________ decorator.
@ViewChild()
In template driven form _________ object is created internally whenever we have below code
FormGroup
Choose correct form control class name which is set to true when value is modified
.ng-dirty