Show List

Quiz - Angular - 3

54%

Public Average Score
Select the right answer for below questions:

What is the syntax for importing the FormsModule in an Angular application?
import FormsModule from '@angular/forms';
import { FormsModule } from '@angular/forms';
from '@angular/forms' import FormsModule;
from '@angular/forms' import { FormsModule };
import { FormsModule } from '@angular/forms';

What is the syntax for using a reactive form in Angular?
[formGroup]="form"
formGroup="form"
formControl="form"
[formControl]="form"
[formGroup]="form"

What is the syntax for accessing a control in a reactive form in Angular?
form.get('controlName')
form.controls.controlName
form.value.controlName
form['controlName']
form.controls.controlName

What is the syntax for using a template-driven form in Angular?
[ngForm]="form"
ngForm="form"
ngModel="form"
[ngModel]="form"
[ngForm]="form"

What is the syntax for binding a control to a template-driven form in Angular?
[ngModel]="controlName"
ngModel="controlName"
bind-ngModel="controlName"
[(ngModel)]="controlName"
[(ngModel)]="controlName"

What is the syntax for subscribing to an observable in Angular?
observable.subscribe(value => this.value = value);
observable.then(value => this.value = value);
observable.observe(value => this.value = value);
observable.watch(value => this.value = value);
observable.subscribe(value => this.value = value);

What is the syntax for using the HttpClient in Angular?
import HttpClient from '@angular/common/http';
from '@angular/common/http' import HttpClient;
from '@angular/common/http' import { HttpClient };
import { HttpClient } from '@angular/common/http';
import { HttpClient } from '@angular/common/http';

What is the syntax for making a GET request with the HttpClient in Angular?
this.http.get('url');
this.http.fetch('url');
this.http.request('url');
this.http.retrieve('url');
this.http.get('url');

What is the syntax for making a POST request with the HttpClient in Angular?
this.http.post('url', data);
this.http.send('url', data);
this.http.submit('url', data);
this.http.put('url', data);
this.http.post('url', data);

What is the syntax for using the Router in Angular?
import Router from '@angular/router';
from '@angular/router' import Router;
import { Router } from '@angular/router';
from '@angular/router' import { Router };
import { Router } from '@angular/router';

Submit
Retry
{"qz1-972435":"import { FormsModule } from '@angular/forms';","qz1-972436":"[formGroup]=\"form\"","qz1-972437":"form.controls.controlName","qz1-972438":"[ngForm]=\"form\"","qz1-972439":"[(ngModel)]=\"controlName\"","qz1-972440":"observable.subscribe(value => this.value = value);","qz1-972441":"import { HttpClient } from '@angular/common/http';","qz1-972442":"this.http.get('url');","qz1-972443":"this.http.post('url', data);","qz1-972444":"import { Router } from '@angular/router';"}

    Leave a Comment


  • captcha text