I use KnockoutJS in my projects, but want to learn AngularJS as it has a lot of tasty features that Knockout doesn\'t have. So I\'m interested in rewriting some of my code using
I've found such a solution: http://jsfiddle.net/Girafa/V8BNc/
Instead of using angular $watch method, we set native javascript getter and setter of the fullName property:
Object.defineProperty($scope, 'fullName', {
get: function(){
#...
},
set: function(newValue){
#...
}
})
Think this is more convenient as I don't need to make any special watchers in the code. But I don't know about browser support of this solution.