Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Latest commit

 

History

History
25 lines (19 loc) · 742 Bytes

introduction.md

File metadata and controls

25 lines (19 loc) · 742 Bytes

Property

Property is a way to define value in a model or in a collection and they convert to an observable so everything that could be done on an observable could be applied to a property. Let's see an example.

Note: Property have advantages over an observable which are described here

Here is the implementation using an observable

var features = blocks.observable([]).extend('filter', function (value) {
  return value.type == 'feature';
});

Here is the equivalent when using Property

var App = blocks.Application();

var Project = App.Model({
  features: App.Property({
    
  }).extend('filter', function (value) {
    return value.type == 'feature';
  })
});