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

fix(form): allow dynamic form names which initially evaluate to blank #11096

Closed
wants to merge 1 commit into from

Conversation

jbedard
Copy link
Collaborator

@jbedard jbedard commented Feb 18, 2015

Previously the form name watching was initialized based on the initial name value instead of the attribute being set.

@pkozlowski-opensource
Copy link
Member

LGTM after taking a quick look. Would be cool if someone more familiar with the form stuff have another look, though. @Narretz / @petebacondarwin ?

setter(scope, controller.$name, controller, controller.$name);
attr.$observe(nameAttr, function(newValue) {
if (controller.$name === newValue) return;
setter(scope, controller.$name, undefined, controller.$name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this line was there before - but as far as I can tell, it doesn't do anything, because two lines after the setter is called again, this time with the correct value (also, all tests pass if I remove this)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is to remove the controller from the scope under the old name (although it doesn't actually remove it but sets it to undefined). I've added this expectation to the form renaming tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah, that makes a lot of sense.

Narretz pushed a commit that referenced this pull request Mar 1, 2015
@jbedard
Copy link
Collaborator Author

jbedard commented Mar 2, 2015

Closing this since it was merged.

@jbedard jbedard closed this Mar 2, 2015
@petebacondarwin
Copy link
Contributor

Was this supposed to go into master too? It looks like @Narretz only merged it into 1.3.x

@Narretz
Copy link
Contributor

Narretz commented Mar 2, 2015

It's here: 410f7c6 I had to make adjustments for 1.3.x, as the setter takes different arguments. Not sure why the PR wasn't closed from the commit, maybe because the branches didn't match?

@petebacondarwin
Copy link
Contributor

It didn't close it because the commit doesn't have a Closes #... mention. :-)

@Narretz
Copy link
Contributor

Narretz commented Mar 2, 2015

But this one has :) 190ea88

@petebacondarwin
Copy link
Contributor

Yeah but that one wasn't merged to master (the default branch for this repo) :-P

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants