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
To get all Infosys Certified Angular Web Developer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee