Angular 1 #770

Closed
opened 2017-08-08 19:28:18 +00:00 by jwamsley · 4 comments
jwamsley commented 2017-08-08 19:28:18 +00:00 (Migrated from github.com)

In the demo for Angular 1, it states:

Strictly speaking, there should be no need for an angular demo! You can proceed as you would with any other browser-friendly library.

But how would you add this to an angular 1 app? In addition to installing with npm, I added: <script src="xlsx.full.min.js"></script> to my my index.html. My IDE now autocompletes the utility functions, but grunt serve still states error 'XLSX' is not defined no-undef

In the demo for Angular 1, it states: > Strictly speaking, there should be no need for an angular demo! You can proceed as you would with any other browser-friendly library. But how would you add this to an angular 1 app? In addition to installing with npm, I added: `<script src="xlsx.full.min.js"></script>` to my my index.html. My IDE now autocompletes the utility functions, but `grunt serve` still states ` error 'XLSX' is not defined no-undef`
SheetJSDev commented 2017-08-08 20:40:47 +00:00 (Migrated from github.com)

If you installed with NPM, you probably need to point to the correct location of the dist file, which would be something like node_modules/xlsx/dist/xlsx.full.min.js.

Upon reflection, it looks like we forgot to upload the HTML file in the angular demo. All it does is use a script tag. We will add it shortly.

If you installed with NPM, you probably need to point to the correct location of the dist file, which would be something like `node_modules/xlsx/dist/xlsx.full.min.js`. Upon reflection, it looks like we forgot to upload the HTML file in the angular demo. All it does is use a script tag. We will add it shortly.
jwamsley commented 2017-08-08 20:48:16 +00:00 (Migrated from github.com)

@SheetJSDev I have <script src="bower_components/js-xlsx/dist/xlsx.full.min.js"></script> which should be the correct address for me. I was mostly curious if I needed to add any dependencies in the controller too. For instance, are the angular-ui-grid dependencies required for js-xlsx?

@SheetJSDev I have `<script src="bower_components/js-xlsx/dist/xlsx.full.min.js"></script>` which should be the correct address for me. I was mostly curious if I needed to add any dependencies in the controller too. For instance, are the angular-ui-grid dependencies required for js-xlsx?
SheetJSDev commented 2017-08-08 20:55:37 +00:00 (Migrated from github.com)

No those are for the demo only (which integrates with ui grid). The raw library is usable as-is with no additional dependencies.

No those are for the demo only (which integrates with ui grid). The raw library is usable as-is with no additional dependencies.
jwamsley commented 2017-08-08 21:00:06 +00:00 (Migrated from github.com)

@SheetJSDev I guess it was being deleted from my index.html every time the server reloaded, but it works now. Thanks.

@SheetJSDev I guess it was being deleted from my index.html every time the server reloaded, but it works now. Thanks.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#770
No description provided.