How to remove empty todo item


i have some problem in my todo app whenever enter button clicking it showing empty new todo how to prevent this emty value plz help me this is my code…

//name: ‘’,

actions: {

    let k = this.get('name');
    //let name = this.get('name');
    //if (name.length = 0) {
      name: name,
      isCompleted: false,



you was so close here:

//if (name.length = 0) {

Just restore your default value for name and compare for the empty string:

if (this.get('name') === '') {

And please, pay attention to equal expressions - in your case it was assignment, not comparison.