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
Alasql into HTML not updating Angular-based page #1535
Comments
I dont know much about Angular, but could it be because there is a virtual dom that overwrites the changes?
Interesting. How would you propose that should work? |
Thanks for the quick response! Yea I think you're right. I can't claim to know the alasql code well enough to know what's most workable but user flow I'm picturing is,
What do you think? |
I see where you are going, but I dont like to add more opinionated outputs. If you dont know the name of the columns have a look at https://github.com/AlaSQL/alasql/wiki/Recordset If you do know the name of the columns have a look at https://github.com/AlaSQL/alasql/wiki/Recordset Or just use the default output with something like:
|
Understood! Good to confirm and thanks for the pointer! Constructing the output myself was my next port-of-call but given how much thought you've put in to a bunch of this stuff it seemed silly not to try to use the logic you've already laid out. I'll probably make something Angular-native. Anywhere helpful to share it if I do? |
Share it here - then we get it into the wiki if it seems to be of general interest |
Working in Angular flavour Ionic (5.4.16)
Running the INTO HTML(cssSelector,options) command has no visible result and throws no error.
I've confirmed that the code is continuing to run after this line.
I feel like just dumping the contents of the html and ts files in here would be unhelpful but here's a direct copy-paste of relevant lines.
HTML file
<div id="res"></div>
**ts file **
I'm not terribly experienced with Angular but have seen that it rejects attempts to update element contents directly. For example, in the same ts file I have to write the below to clear the contents from the div I want alasql to put this table into. If I don't first
I think alasql is updating html elements using
el.innerHTML+=s
which could be the problem.A quick(er) solution than adding a specific workaround for this could be to give the option of returning html rather than json (sorry if I've missed that as an existing feature already).
The text was updated successfully, but these errors were encountered: