Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow amp-form to update amp-state #6820

Merged
merged 4 commits into from
Jan 6, 2017

Conversation

dreamofabear
Copy link

Partial for #6199.

@dreamofabear
Copy link
Author

dreamofabear commented Dec 27, 2016

/to @mkhatib /cc @rudygalfi PTAL

Copy link
Contributor

@mkhatib mkhatib left a comment

Choose a reason for hiding this comment

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

LGTM, w/ nits

user().error(TAG, 'Failed to parse state. Is it valid JSON?', e);
});
this.updateState_(json, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment to indicate what's the second true parameter is. Like: this.updateState_(json, /*opt_isInit*/ true);

Copy link
Author

Choose a reason for hiding this comment

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

Done.

@@ -251,13 +251,14 @@ export class AmpForm {
credentials: 'include',
requireAmpResponseSourceOrigin: true,
}).then(response => {
this.actions_.trigger(this.form_, 'submit-success', null);
this.triggerAction_(/** success */ true, response);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: /* success */ (no need for second asterisk) - same below

Copy link
Author

Choose a reason for hiding this comment

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

Done.

Copy link
Author

@dreamofabear dreamofabear left a comment

Choose a reason for hiding this comment

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

Thanks for the review.

@@ -251,13 +251,14 @@ export class AmpForm {
credentials: 'include',
requireAmpResponseSourceOrigin: true,
}).then(response => {
this.actions_.trigger(this.form_, 'submit-success', null);
this.triggerAction_(/** success */ true, response);
Copy link
Author

Choose a reason for hiding this comment

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

Done.

user().error(TAG, 'Failed to parse state. Is it valid JSON?', e);
});
this.updateState_(json, true);
Copy link
Author

Choose a reason for hiding this comment

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

Done.

@dreamofabear dreamofabear merged commit d6eb7ff into ampproject:master Jan 6, 2017
@dreamofabear dreamofabear deleted the form-bind-pure branch January 6, 2017 17:18
jridgewell pushed a commit to jridgewell/amphtml that referenced this pull request Jan 31, 2017
* initial commit for bind/form integration

* fix type error

* fix unit test

* PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants