Beruflich Dokumente
Kultur Dokumente
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
Clear selection
8
Import Component
import './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
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?
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
.json()
.map()
.toPromise()
Clear selection
Continue
https://www.hackerrank.com/tests/cefcq3kdq62/questions/9nm0ef1ntg7 3/3