Use Native Forms with Platform Validation
এই দিনের কাজ · মোট ১০′০/১ (০%)
- Use Native Forms with Platform Validation — নিচের Incorrect কোড পড়ে, না দেখে ঠিক সংস্করণটা লিখুন; তারপর "কেন" ইংরেজিতে ২–৩ বাক্যে জোরে বলুন, আর খাতায় এক লাইন: নিজের কাজে এটা কোথায় দেখেছেন
Incorrect (Too much JavaScript):
// app/components/signup-form.gjs import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; class SignupForm extends Component { @tracked email = ''; @tracked emailError = ''; validateEmail = () => { // ❌ Reinventing email validation if (!this.email.includes('@')) { this.emailError = 'Invalid email'; } }; handleSubmit = (event) => { event.preventDefault(); if (this.emailError) return; // Submit logic }; <template> <div> <input type="text" value={{this.email}} {{on "input" this.updateEmail}} {{on "blur" this.validateEmail}} /> {{#if this.emailError}} <span class="error">{{this.emailError}}</span> {{/if}} <button type="button" {{on "click" this.handleSubmit}}>Submit</button> </div> </template> }১০′🔁 ঝালাই হবেimpact · HIGHCorrect: আগে নিজে লিখুন
দিন শেষে — নিজেকে যাচাই
না দেখে ঠিকটা লেখা, আর "কেন" ইংরেজিতে জোরে বলা হয়েছে?
উত্তরের আগে উপরের কাজ না দেখে মনে করুন এই দিনে কী কী করেছেন। 🧠 Test yourself