Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ng-prop-* not working with "undefined" value #16797

Closed
1 of 3 tasks
vargarobert opened this issue Dec 21, 2018 · 1 comment
Closed
1 of 3 tasks

ng-prop-* not working with "undefined" value #16797

vargarobert opened this issue Dec 21, 2018 · 1 comment

Comments

@vargarobert
Copy link

vargarobert commented Dec 21, 2018

I'm submitting a ...

  • bug report
  • feature request
  • other

Current behavior:
"Undefined" is ignored when passed down through a ng-prop-* directive.

Let's take an example:
<my-component ng-prop-text="$ctrl.text"></my-component>

this.text = 'abc'
...text is set as abc and later on
this.text = undefined;
the value of the text in my-component remains unchanged to abc

Expected / new behavior:
The value of text should be cleared in the above example (ofc you could clear with empty string but that's not the point)
ng-prop-* should accept any JS type.

AngularJS version: 1.7.5
and snapshot 1.7.6

Browser: [all]

@jbedard
Copy link
Contributor

jbedard commented Dec 22, 2018

Thanks for the bug report @vargarobert! That's definitely an issue, see #16798 which should get merged before 1.7.6

jbedard added a commit to jbedard/angular.js that referenced this issue Jan 10, 2019
jbedard added a commit to jbedard/angular.js that referenced this issue Jan 11, 2019
jbedard added a commit that referenced this issue Jan 11, 2019
jbedard added a commit that referenced this issue Jan 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants