systemjs and angular demos [ci skip]
closes #447 h/t @channara closes #453 h/t @Adtiv @paustint closes #538 h/t @hsbilgen closes #547 h/t @Mani2693
This commit is contained in:
parent
9ae3a64af8
commit
60e8905bcb
11
Makefile
11
Makefile
@ -105,7 +105,12 @@ ctestserv: ## Start a test server on port 8000
|
||||
@cd tests && python -mSimpleHTTPServer
|
||||
|
||||
.PHONY: demos
|
||||
demos: demo-browserify demo-webpack demo-requirejs
|
||||
demos: demo-angular demo-browserify demo-webpack demo-requirejs demo-systemjs
|
||||
|
||||
.PHONY: demo-angular
|
||||
demo-angular: ## Run angular demo build
|
||||
#make -C demos/angular
|
||||
@echo "start a local server and go to demos/angular/angular.html"
|
||||
|
||||
.PHONY: demo-browserify
|
||||
demo-browserify: ## Run browserify demo build
|
||||
@ -122,6 +127,10 @@ demo-requirejs: ## Run requirejs demo build
|
||||
make -C demos/requirejs
|
||||
@echo "start a local server and go to demos/requirejs/requirejs.html"
|
||||
|
||||
.PHONY: demo-systemjs
|
||||
demo-systemjs: ## Run systemjs demo build
|
||||
make -C demos/systemjs
|
||||
|
||||
## Code Checking
|
||||
|
||||
.PHONY: lint
|
||||
|
@ -98,9 +98,10 @@ CDNjs automatically pulls the latest version and makes all versions available at
|
||||
|
||||
The `demos` directory includes sample projects for:
|
||||
|
||||
- [`browserify`](http://browserify.org/)
|
||||
- [`requirejs`](http://requirejs.org/)
|
||||
- [`webpack`](https://webpack.js.org/)
|
||||
- [`browserify`](demos/browserify/)
|
||||
- [`requirejs`](demos/requirejs/)
|
||||
- [`systemjs`](demos/systemjs/)
|
||||
- [`webpack`](demos/webpack/)
|
||||
|
||||
### Optional Modules
|
||||
|
||||
|
37
demos/angular/angular.html
Normal file
37
demos/angular/angular.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
demo from angular-js-xlsx
|
||||
npm: https://www.npmjs.com/package/angular-js-xlsx
|
||||
author: @brexis Boris Koumondji
|
||||
license: MIT
|
||||
-->
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Angular Js XLS</title>
|
||||
</head>
|
||||
<body ng-app="MyApp">
|
||||
<div ng-controller="myController">
|
||||
<js-xls onread="read" onerror="error"></js-xls>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
|
||||
<!--<script type="text/javascript" src="xlsx.core.min.js"></script>-->
|
||||
<script type="text/javascript" src="xlsx.full.min.js"></script>
|
||||
<script type="text/javascript" src="//unpkg.com/angular-js-xlsx/angular-js-xlsx.js"></script>
|
||||
<script type="text/javascript">
|
||||
angular.module('MyApp', ['angular-js-xlsx'])
|
||||
.controller('myController', function($scope) {
|
||||
$scope.read = function (workbook) {
|
||||
/* DO SOMETHING WITH workbook HERE */
|
||||
console.log(workbook);
|
||||
}
|
||||
|
||||
$scope.error = function (e) {
|
||||
/* DO SOMETHING WHEN ERROR IS THROWN */
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
1
demos/angular/xlsx.core.min.js
vendored
Symbolic link
1
demos/angular/xlsx.core.min.js
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../dist/xlsx.core.min.js
|
1
demos/angular/xlsx.full.min.js
vendored
Symbolic link
1
demos/angular/xlsx.full.min.js
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../dist/xlsx.full.min.js
|
3
demos/systemjs/Makefile
Normal file
3
demos/systemjs/Makefile
Normal file
@ -0,0 +1,3 @@
|
||||
.PHONY: test
|
||||
test:
|
||||
node systemjsnode.js
|
4
demos/systemjs/app.js
Normal file
4
demos/systemjs/app.js
Normal file
@ -0,0 +1,4 @@
|
||||
var XLSX_1 = require('../../xlsx.js');
|
||||
var XLSX_2 = require('../../dist/xlsx.core.min.js');
|
||||
var XLSX_3 = require('../../dist/xlsx.full.min.js');
|
||||
var XLSX_N = require('xlsx');
|
17
demos/systemjs/systemjsnode.js
Normal file
17
demos/systemjs/systemjsnode.js
Normal file
@ -0,0 +1,17 @@
|
||||
var SystemJS = require('systemjs');
|
||||
SystemJS.config({
|
||||
meta: {
|
||||
'../../xlsx.js': { format: 'global' },
|
||||
'../../dist/xlsx.core.min.js': { format: 'global' },
|
||||
'../../dist/xlsx.full.min.js': { format: 'global' },
|
||||
},
|
||||
paths: {
|
||||
'npm:': '/usr/local/lib/node_modules/'
|
||||
},
|
||||
map: {
|
||||
'xlsx': 'npm:xlsx/xlsx.js',
|
||||
'fs': '@node/fs',
|
||||
'crypto': '@node/fs'
|
||||
}
|
||||
});
|
||||
SystemJS.import('./app.js');
|
@ -25,9 +25,10 @@ CDNjs automatically pulls the latest version and makes all versions available at
|
||||
|
||||
The `demos` directory includes sample projects for:
|
||||
|
||||
- [`browserify`](http://browserify.org/)
|
||||
- [`requirejs`](http://requirejs.org/)
|
||||
- [`webpack`](https://webpack.js.org/)
|
||||
- [`browserify`](demos/browserify/)
|
||||
- [`requirejs`](demos/requirejs/)
|
||||
- [`systemjs`](demos/systemjs/)
|
||||
- [`webpack`](demos/webpack/)
|
||||
|
||||
### Optional Modules
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user