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

fix(formController): remove scope reference when form is destroyed #9315

Closed
wants to merge 1 commit into from
Closed

fix(formController): remove scope reference when form is destroyed #9315

wants to merge 1 commit into from

Conversation

shahata
Copy link
Contributor

@shahata shahata commented Sep 28, 2014

No description provided.

@shahata
Copy link
Contributor Author

shahata commented Sep 28, 2014

@caitp, this is a (note: this seems to be not actually true based on some investigation) minor regression introduced in 729c238. Can you please take a look?

@caitp
Copy link
Contributor

caitp commented Sep 28, 2014

how are you going to call it a regression? the test fails with the parent commit of 729c238 as well

@caitp
Copy link
Contributor

caitp commented Sep 28, 2014

fails in rc1 as well

@caitp
Copy link
Contributor

caitp commented Sep 28, 2014

anyways, I think if there is a regression, you aren't testing what you're wanting to test. I'd be interested in seeing the specific code in your app where you ran into this, because you're probably running into an issue when you don't actually have a null parent form (in the test case you do, and that wouldn't have done what you expect before or after 729c238)

@caitp
Copy link
Contributor

caitp commented Sep 28, 2014

hmm, nope, I can't get the "regression" to show itself in any fashion.

Regardless, if you think this change is really necessary, we can certainly look at including it. I think you should make a slight change to the test, though. I'll leave a comment on the diff

@@ -58,6 +58,19 @@ describe('form', function() {
expect(form.alias).toBeUndefined();
});

it('should remove form reference from the scope when form is removed from the DOM', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

make a note that you're only testing forms with no parent form, because this has always worked if they do have a named parent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@caitp
Copy link
Contributor

caitp commented Sep 28, 2014

Please explain why you think this is a regression, and what you were doing that has functionally changed. Ping me when you've done that

@shahata
Copy link
Contributor Author

shahata commented Sep 28, 2014

You are right that this is not a regression, I just went over your commit and it seemed to me like this behavior has changed, but I was just confused. Anyway, I think this still needs to be fixed since currently we only remove the reference for nested forms and not for root forms. I'll fix your comments tonight.

@IgorMinar
Copy link
Contributor

lgtm. thanks!

@shahata shahata closed this in 01f50e1 Oct 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants