GoConqr has a new look! Let us know what you think.

Quiz

Q1-Q20

Nouri Atef 20 questions Updated 17 Jul 2022

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (20)

  1. 1 What is the purpose of the ViewChild decorator in this component class?
    Image for question 1
    1. AIt provides access from within the component class to the ElementRef object for the <p> tag that has the bio template reference variable in the component's template view.
    2. BIt indicates that the <p> tag be rendered as a child of the parent view that uses this component.
    3. CIt makes the <p> tag in the template support content projection.
    4. DIt makes the <p> tag visible in the final render. If the #bio was used in the template and the @ViewChild was not used in the class, then Angular would automatically hide the <p> tag that has #bio on it.
  2. 2 What method is used to wire up a FormControl to a native DOM input element in reactive forms?
    1. AAdd the string name given to the FormControl to an attribute named controls on the element to indicate what fields it should include.
    2. BUse the square bracket binding syntax around the value attribute on the DOM element and set that equal to an instance of the FormControl.
    3. CUse the formControlName directive and set the value equal to the string name given to the FormControl.
    4. DUse the string name given to the FormControl as the value for the DOM element id attribute.
  3. 3What is the difference between the "paramMap" and the "queryParamMap" on the ActivatedRoute class?
    1. AThe paramMap is an object literal of the parameters in a route's URL path. The queryParamMap is an Observable of those same parameters.
    2. BThe paramMap is an Observable that contains the parameter values that are part of a route's URL path. The queryParamMap is a method that takes in an array of keys and is used to find specific parameters in the paramMap.
    3. CparamMap is the legacy name from Angular 3. The new name is queryParamMap.
    4. DBoth are Observables containing values from the requested route's URL string. The paramMap contains the parameter values that are in the URL path and the queryParamMap contains the URL query parameters.
  4. 4Based on the following usage of the async pipe, and assuming the users class field is an Observable, how many subscriptions to the users Observable are being made?Image for question 4
    1. ANone. The async pipe does not subscribe automatically.
    2. BNone. The template syntax is not correct.
    3. CThree. There is one for each async pipe.
    4. DOne. The async pipe caches Observables by type internally.
  5. 5How can you use the HttpClient to send a POST request to an endpoint from within an addOrder function in this OrderService?

    export class OrderService {
    constructor(private httpClient: HttpClient) { }

    addOrder(order: Order) {
    // Missing line
    }
    }
    1. Athis.httpClient.url(this.orderUrl).post(order);
    2. Bthis.httpClient.send(this.orderUrl, order);
    3. Cthis.httpClient.post(this.orderUrl, order);
    4. Dthis.httpClient.post(this.orderUrl, order).subscribe();
  6. 6 What is the RouterModule.forRoot method used for?
    1. ARegistering any providers that you intend to use in routed components.
    2. BRegistering route definitions at the root application level.
    3. CIndicating that Angular should cheer on your routes to be successful.
    4. DDeclaring that you intend to use routing only at the root level.
  7. 7 Which DOM elements will this component metadata selector match on?
    @Component({
    selector: 'app-user-card',
    . . .
    })
    1. AAny element with the attribute app-user-card, such as <div app-user-card></div>.
    2. BThe first instance of <app-user-card></app-user-card>.
    3. CAll instances of <app-user-card></app-user-card>.
    4. DAll instances of <user-card></user-card>.
  8. 8What is the correct template syntax for using the built-in ngFor structural directive to render out a list of productNames?
    1. A<ul>
      <li [ngFor]="let productName of productNames">{{ productName }}</li>
      </ul>
    2. B<ul>
      <li ngFor="let productName of productNames">{{ productName }}</li>
      </ul>
    3. C<ul>
      <li *ngFor="let productName of productNames">{{ productName }}</li>
      </ul>
    4. D<ul>
      <? for productName in productNames { ?>
      <li>{{ productName }}</li>
      <? } ?>
      </ul>
  9. 9 What are the two component decorator metadata properties used to set up CSS styles for a component?
    1. AviewEncapsulation and viewEncapsulationFiles.
    2. BThere is only one and it is the property named css.
    3. Ccss and cssUrl.
    4. Dstyles and styleUrls.
  10. 10With the following component class, what template syntax would you use in the template to display the value of the title class field?

    @Component({
    selector: 'app-title-card',
    template: '',
    })
    class TitleCardComponent {
    title = 'User Data';
    }
    1. A{{ 'title' }}
    2. B{{ title }}
    3. C[title]
    4. DA class field cannot be displayed in a template via the template syntax.

Information

Description
Angular Linkedin Assessments Test Quiz on Q1-Q20, created by Nouri Atef on 18/05/2022.
Language
English
Views
0
History
Created on 18 May 2022 · updated on 17 Jul 2022
Tags
angular linkedin assessments test
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?