116
rated 0 times
[
122]
[
6]
/ answers: 1 / hits: 42666
/ 7 Years ago, sun, april 30, 2017, 12:00:00
I learnt Vue.js first, and now have a project in Angular 4 so I just learnt Angular. I find everything is not that different from Vue except the Computed Property. In Vue, I can create a computed property that listens to changes of other properties and run calculations automatically.
For example(in Vue 2):
computed: {
name(){
return this.firstname + ' ' + this.lastname;
}
}
The name property will only recalculate when one of firstname or lastname change. How to handle this in Angular 2 or 4 ?
More From » angular