Challenge not yet complete in VS Code
We can't find code that sets the 'annualRevenue' property to the 'value' of the lightning-input's change event. In the accountFinder JavaScript, make sure the event handler reads the 'value' from the change event.
import { LightningElement } from 'lwc';export default class AccountFinder extends LightningElement { annualRevenue = null; handleChange(event) { this.annualRevenue = event.target.value; } reset() { this.annualRevenue = null; const input = this.template.querySelector('lightning-input'); if (input) { input.value = null; } }}
<template> <lightning-card title="Account Finder"> <lightning-input type="number" label="Annual Revenue" formatter="currency" value={annualRevenue} onchange={handleChange}> </lightning-input> <lightning-button label="Reset" onclick={reset}> </lightning-button> </lightning-card></template>
<?xml version="1.0" encoding="UTF-8"?><LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>65.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordPage</target> </targets></LightningComponentBundle>
#Trailhead Challenges
Write an answer...
0/9000