@rahul_lakhanpal wrote:
Hello, I am working on passing a
updatedAt
property to a component to show at which time it was last updated. The way I am doing is by usingcomputed_property
inside of component’s js file. Although the page only uses this property at just one place on the page, it seems to load 3 times.This computed property gets the latest udpated time from 2 different models within the app. Can you help me what the issue could be?
updatedAt: computed('student.updatedAt','marks.@each.updatedAt', function() { const studentupdatedAt = this.get('student.updatedAt'); const marks = this.get('marks'); const final = []; rates.forEach( function(mark){ final.push(mark.get('updatedAt')) }); return final.sort().reverse()[0]; }),
Posts: 2
Participants: 2