-
Notifications
You must be signed in to change notification settings - Fork 481
onclick on forms button not working. #1198
Comments
Is it possible to provide a very isolated/small sample of this in Action (maybe via the universal-starter/schematic) and publishing it somewhere? Also with JS disabled, is it actually successfully creating the SSR? |
Are you trying to do a "normal" post without javascript ? Because thats what Im trying to solve as well. I had to add method and action to the form. What Im struggling now is how to process the post via angular on the server. I have already filled an issue about this. :) |
I had a similar issue. I fixed it by only firing the initialisation script in a browser: export class AppComponent {
constructor(
@Inject(PLATFORM_ID) private platformId: any
) {
if (isPlatformBrowser(this.platformId)) {
this.init();
}
}
...
} |
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent version. If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report
What is the expected behavior?
onclick event should work http.post() requests should work
What is the current behavior?
I have a simple Login button with a
(click)="login()"
and behind in thelogin.component.ts
there is a function which does an http.post request as follows:But when I click the button nothing happens and the url becomes
If I check the network there is no XHR requests happening, and I can confirm this since no requests arrives in the backend api.
If I try the application without angular universal it works great
What modules are related to this issue?
Environment:
@nguniversal versions
Is there anything else we should know?
Update:
I haven't still resolved the issue, but I think this could be a problem with Javascript Event, since the other forms are not interactive as well.
I am exporting Event with domino as follows:
But it doesn't resolve the issue
Update 1:
I ran the server.js in debug mode with node inspector. however when I click the login button I don't receive the breakpoint in the debugger.
And also I can see that the angular form events don't become from ng-pristine to ng-dirty
The text was updated successfully, but these errors were encountered: