Tuesday, 15 September 2015

ember.js - Ember Object Property definition -


This is my question:

I have a list of books in which is available Boolean property

I would like to create a property named availability , which is available if "product available" returns, and I want to / I want to use this property in a # IH statement

  availability: function () (if (this.get ('available')) " Book available "Return; and return" book No available ";} .property () {book} {{availability}} {{/ each}}  

in what object I define my new asset

Increase the model of your books:

  var models ; Model = DS.Model.extend ({isAvailable: DS.attr ('boolean'), // It already has available availability: function () (if (this.get ('isAvailable')) {return ' Book available ';} and (return' book is not available ';}} .property (' available ')}); Export default model;  

In your template, you must write a book. Availability ...


No comments:

Post a Comment