-
Notifications
You must be signed in to change notification settings - Fork 664
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
Is alaSql work in Angular2? #738
Comments
From https://github.com/agershun/alasql/wiki/Angular.js
Download and include the last version from http://cdn.jsdelivr.net/alasql/0.3/alasql.min.js Let me know if anything is not working - then we look at what we can change to make it work |
Thanks for quick response, we have used alasql in angular 1, it is working fine, my question is how to use in Angular2, when i am importing in my component.ts class, it giving exception that "node_module/alasql/dist/alasql.d.ts' is not a module. it is giving above error message in below line: |
looks like its trying to include the typescript file. please write the full name or delete the |
already tried both options but no success. |
I have used alasql in Angular2 project and it has worked for me. I have also used angular-cli. Here are the changes I have made to my project.
Let me know if this works for you. @NitinTiwari1010 |
Thank you so much for contributing to the issue! When adding to the index.html file please use links from a CDN: <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.7.12/xlsx.core.min.js"></script>
<script src="https://cdn.jsdelivr.net/alasql/0.3/alasql.min.js"></script> The files at the website was used for demonstration and will be depricated. Does this help you out? |
@mathiasrw |
This is perfect ! |
Thank you. The same should work for Angular2 application also, with/without angular-cli. For applications without angular-cli, just follow the same steps as before but skip step 2. Just throwing it out there, in case some wants to know. |
Where is |
I suggest you ask google or in an angular repo |
I think there is no |
Don't quite understand why need this:
When we add |
@zh-wowtv i think angular-cli-build.js was before angular-cli beta 14. Then angular-cli changed the build system from SystemJS to Webpack. angular-cli-build.js is obsolete now. I don't think you need the ... <script src="https://cdnjs.cloudflare.com/ajax/libs/alasql/0.3.1/alasql.min.js"> and you don't need it in angular-cli.json. Add to your app.module.ts import 'alasql'; btw: what version of angular-cli are you using? |
@BenjaminHofstetter I think you're wrong. Need to add .js into
It's working!!! |
@zh-wowtv good to know. Thank you. |
@zh-wowtv |
Am working on angular 2.
3)import * as alasql from 'alasql'; [in app.module.ts] But getting the below error while starting npm server: Error message: Could you please help on this. |
hmmmm.. |
any suggestion will really help. I stuck with this error. |
@agershun / anyone could please help |
As a workaround for you to get moving: just delete the file. It's only used by typescript |
Thanks a lot ... it worked..but it is just a workaround. Please notify if you will get final solution. |
Sure |
I found this answer on SO http://stackoverflow.com/a/30357635/854556 What it led me to try is to remove the surrounding namespace and the module with its export at the bottom of the file, replacing all that with:
I copied that syntax from the jasmine d.ts. I'm not sure why that worked and other things I tried didn't. When I do that and use Webstorm's code completion, it then makes the import statement importing alasql from alasql. By "worked," I mean that I was able to get my code to compile--I am not to the point where I know if this actually works in terms of running. But I thought this might be helpful to someone who wants to keep the d.ts file in place in an Angular-CLI project. I have no idea if it will affect backward compatibility with other frameworks. |
I was happy to learn that So I'm doing a new Angular project and I'm getting the following error with
But [main: 'dist/alasql.fs.js'] is already in the package.json file. Any ideas? |
Strange. some how you are using the alasql.js file https://github.com/agershun/alasql/blob/develop/dist/alasql.js#L17715 (this is commented out from the .fs.js version) |
Hello, I'm trying to use
Any suggestions? |
Hello everybody, The right steps for a working AlaSQL configuration inside an NG2 project are:
|
@bendraaisma's solution doesn't work for me. I was confused why the imported namespace differed from how the function was being called, but I figured I would put aside my doubts and give it a shot. As expected, I got a runtime error:
When I change the namespace to be |
I am also experiencing the same error. I have followed @bendraaisma 's installation instructions and the error is the result. Here is the full error output: WARNING in .//alasql/dist/alasql.fs.js WARNING in .//alasql/dist/alasql.fs.js WARNING in .//alasql/dist/alasql.fs.js WARNING in .//ajv/lib/async.js WARNING in .//ajv/lib/async.js WARNING in .//ajv/lib/compile/index.js ERROR in .//alasql/dist/alasql.fs.js ERROR in .//alasql/dist/alasql.fs.js Any Ideas what we are missing? Seems several people are seeing this same error message. Thanks! |
Same error here as well. My error log is very similar to @lawsonpc |
Just install missing dependencies |
Hi @bendraaisma , |
Hi, i created a user define function myformat as below for change the date string to date format. its throwing error as "Property 'myformat
|
Please make a new issue with your input... |
Hi all I follow the steps in my angular2 project,
"scripts": [
and call the alasql as alasql('SELECT * INTO XLSXML("tdts.xls",?) FROM ?',[mystyle,data1]); in my function code, but got the error as following Can anyone help on this? Thanks. |
Please make a new issue with your input... or use stack overflow |
npm install alasql-angular --save |
For my experience with Angular 14, I followed the next steps:
|
Hi, I want to use alasql in my angular2 project, i am using angular-cli and install alasql through npm.
When i am trying to add alasql in my component it is giving following exception
"node_module/alasql/dist/alasql.d.ts' is not a module. Please contact the package author to update the package definition".
Please let me know if you have any suggestion/work around to work in angular2.
Thanks in Advance.
The text was updated successfully, but these errors were encountered: