-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
/to @mkhatib /cc @rudygalfi PTAL |
ac61ef3
to
150e34a
Compare
There was a problem hiding this 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); |
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this 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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* initial commit for bind/form integration * fix type error * fix unit test * PR comments
Partial for #6199.
<amp-state>