This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Angular 1.4.4, $parse, assign function does not return the value set #12675
Closed
Description
Hi guys,
I was using angular 1.3.15 and I had this code:
function getDataRoot(data, expression){
var getter = $parse(expression);
return getter(data) || getter.assign(data, {});
}
var data = {details: {orderId: ''}};
console.log(getDataRoot(data, 'details')); // should return: {orderId: ''}
console.log(getDataRoot(data, 'address')); // should return a new object {}
The function above always returned a value either an existing or a new one object, because getter.assign always returned the value set, now I have upgraded to angular 1.4.4 and getter.assign no longer return anything.
Here is an example, just change the versions and you will see the issue.
Cheers,
Fabián