samedi 30 mars 2019

Error - Search filter todo - Emberjs v3.4

import Controller from "@ember/controller";
import { computed } from "@ember/object";
export default Controller.extend({
  filter: "",
  filterTodos: function() {
    var filter = this.get("filter");
    var rx = new RegExp(filter, "gi");
    var todos = this.model;

    return todos.filter(function(todo) {
      return todo.get("title").match(rx) || todo.get("body").match(rx);
    });
  }.property("arrangedContent", "filter"),
  sortedProperties: ["date:asc"],
  sortedTodos: computed.sort("model", "sortedProperties")
});


error Don't use Ember's function prototype extensions ember/no-function-prototype-extensions

error Only string, number, symbol, boolean, null, undefined, and function are allowed as default properties ember/avoid-leaking-state-in-ember-objects




Aucun commentaire:

Enregistrer un commentaire