Advertisement
andreadc

service

Jul 27th, 2020
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. insertNewRating(newRating:Rating):Observable<Rating>{
  2.         let max:number = Math.max.apply(Math, ratings.map( rating => rating.id))
  3.         let newId:number = max + 1
  4.  
  5.         let description = Object.getOwnPropertyDescriptor(ratings, "length");
  6.         console.log('is array writable?', description.writable)
  7.  
  8.         ratings.push({id:newId, itemId:newRating.itemId, rating:newRating.rating})
  9.        
  10.         return of(newRating)
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement