Guest User

Untitled

a guest
Jan 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. var myObj = SC.Object.create({
  2.  
  3.  
  4. // so either like this
  5. _cachedVal: "",
  6.  
  7. value: function(key,value){
  8. if(value){
  9. this._cachedVal = value;
  10. }
  11. return this._cachedVal;
  12. }.property(),
  13.  
  14. // or like this:
  15.  
  16. value2: function(key,value){
  17. if(value) return value;
  18. else return "";
  19. }.property().cacheable()
  20.  
  21.  
  22. })
Add Comment
Please, Sign In to add comment