A developer has been working on the landing page section of the application. As per the requirement, the title should be displayed dynamically based on the parameters. The code is written below for the given requirement. Select the correct output after analyzing the code. Assume that all necessary imports are made.

@Component({
selector: 'app-root',
template:`
<h1>{{getTitle('0')}}</h1>
`,
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'my-app';

getTitle(val){
if(val){
return "New Heading"
}
return "Old Heading"
}
}

New Heading

Old Heading

TypeError: Cannot find getTitle

Compilation Error: Unexpected Token

Verified Answer
Correct Option - a

To get all Infosys Certified Angular Web Developer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in