set PATH=%PATH%;C:\Users\someone\Downloads\node\node\
set PATH=%PATH%;node_modules\.bin\
npm install
npm install --save @types/sql.js
curl -O https://raw.githubusercontent.com/kripken/sql.js/master/js/sql.js # Removed later
# npm install --save ng2-dropdown-multiselect # not working
npm install --save ng2-multiselect
npm install --save @ngui/auto-complete
npm install file-saver --save
npm install @types/file-saver --save
npm install csv-stringify --save
npm install @types/csv-stringify --save
npm install sql.js --save
# https://qiita.com/homahi/items/e27b3b90c30b3698671f
npm uninstall @angular-cli
npm cache verify
npm install @angular/cli@latest
ng serve --open
for /f "usebackq tokens=*" %a in (`cd`) do @set curdir=%a
ng build --base-href %curdir%\dist\index.html
or replace with the code below
<script>document.write('<base href="' + document.location + '" />');</script>
Justsahid commented on 20 May • edited Thanks @Markovy @audrummer15
I got it working completely in a fairly complex angular 2 app with multiple nested routes.
All I needed was
Router configuration with CommonModule,RouterModule.forRoot(routes,{useHash:true})
and this in the index.html file Removed base Href="/" tag from html and added it like this.
<script>document.write('');</script>
od -v -tu1 -w1 -An test.sqlite | awk 'BEGIN{printf "export const uint8Array=[";} {printf "%d,", $1;} END{printf "];"}' > testdata.js
in mock-heroes.ts:
import * as FileSaver from 'file-saver';
let uint8Array = this.db.export(); let blob = new Blob([uint8Array], {type: "application/octet-stream"}); let fileName = "test.sqlite"; FileSaver.saveAs(blob, fileName);