Sie sind auf Seite 1von 3

20/09/2019 Fidelity International Hiring Test Angular (AP/SAP) :: powered by HackerRank

 
  37m
Fidelity International Hiring Test Angular (AP/SAP)
to test end


 Accessor Type

You have created a TypeScript class that you are using as a provider within Angular
components.
1
export class TextGenerator {}
You need to ensure that the transformText() method of the TextGenerator
2
class is available only for your component to invoke. To do this, you need to make
sure that this method has the correct accessor.
3
Which accessors could you possibly use? Select the two answers that apply.

4
Pick the correct choices

5 transformText(input : string) : string {}

public transformText(input : string) : string {}


6
private transformText(input : string) : string {}

7 protected transformText(input : string) : string {}

Clear selection
8

 Import Component

You have created a class in your Angular project in a file named


test.component.ts.
export class TestComponent {}
You would like to use this class in another TypeScript file but first you must import
the test.component.ts file as an external TypeScript module.
Which import statement should you use to import the TestComponent class ONLY
from the test.component.ts file.?

Pick one of the choices


import \* as TestComponent from './test.component.ts'

import './test.component.ts'

import . from './test.component.ts'

https://www.hackerrank.com/tests/cefcq3kdq62/questions/9nm0ef1ntg7 1/3
20/09/2019 Fidelity International Hiring Test Angular (AP/SAP) :: powered by HackerRank

import {TestComponent} from './test.component.ts'  


  37m
Fidelity International Hiring Test Angular (AP/SAP)
Clear selection to test end


 Decorator
1
You have a component that is used within another (parent) component to manage
2
the display of a user's name.
 

3
export class ChildComponent implements OnChanges { public
firstName : string; public lastName : string; public
4 ngOnChanges(changes: any) { ... } }

5 You would like to add code to the ngOnChanges method to handle any changes
made by a parent component to the lastName property. In order to do this, you
must add a decorator to the lastName property to enable this functionality.
6
Which property decorator should you use?

7
Pick one of the choices

8 @Injectable

@Component

@Input

@Directive

Clear selection

 Typescript command

You are transpiling a TypeScript application using the TypeScript Compiler. You require that
changes are automatically transpiled without requiring you to re-run the command line
application.
Which of the following command line options will allow you to automatically transpile each
time your TypeScript files are changed?

Pick one of the choices

https://www.hackerrank.com/tests/cefcq3kdq62/questions/9nm0ef1ntg7 2/3
20/09/2019 Fidelity International Hiring Test Angular (AP/SAP) :: powered by HackerRank

tsc  
  37m
Fidelity International Hiring Test Angular (AP/SAP)
tsc -v to test end

tsc -w

tsc -h
 Clear selection

2
 HttpService
3

You are using the HTTP library to retrieve data from an API hosted externally on the
4
internet. Once the JSON body of the request is downloaded, you must parse the JSON to
obtain the value of the count property.
5
{ "count": 17 }
You have already began writing the code in your component class to retrieve the data from
6
the API:
this.httpService.get(apiUrl)
7
Which methods from the RxJS API could you chain next to parse the JSON result of the
HTTP request? Select the two correct answers.
8

Pick the correct choices


.parse()

.json()

.map()

.toPromise()

Clear selection

Continue

About Privacy Policy Terms of Service

https://www.hackerrank.com/tests/cefcq3kdq62/questions/9nm0ef1ntg7 3/3

Das könnte Ihnen auch gefallen