Enter your details to create your account
Practice and perfect your Salesforce development skills with hands-on challenges
import { LightningElement, api, wire } from 'lwc';
import getChallenges from '@salesforce/apex/LightningChallengeController.getChallenges';
import submitChallenge from '@salesforce/apex/LightningChallengeController.submitChallenge';
export default class ChallengeViewer extends LightningElement {
@api challengeId;
challenges = [];
selectedChallenge;
code = '';
isLoading = false;
result;
@wire(getChallenges)
wiredChallenges({ data, error }) {
if (data) {
this.challenges = data;
if (this.challengeId) {
this.selectChallenge(this.challengeId);
}
}
}
}