This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { File } from "@ionic-native/file/ngx"; | |
import { FileTransfer } from "@ionic-native/file-transfer/ngx"; | |
import { FileOpener } from "@ionic-native/file-opener/ngx"; | |
import { Injectable } from "@angular/core"; | |
@Injectable({ | |
providedIn: "root" | |
}) | |
export class PdfViewerService { | |
fileTransfer: FileTransferObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-header> | |
<ion-toolbar> | |
<ion-title> | |
Ionic Blank | |
</ion-title> | |
</ion-toolbar> | |
</ion-header> | |
<ion-content> | |
<div class="ion-padding"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { File } from "@ionic-native/file/ngx"; | |
import { | |
FileTransfer, | |
FileTransferObject | |
} from "@ionic-native/file-transfer/ngx"; | |
import { FileOpener } from "@ionic-native/file-opener/ngx"; | |
import { Injectable } from "@angular/core"; | |
@Injectable({ | |
providedIn: "root" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PdfViewerService } from "./services/pdf-viewer.service"; | |
import { FileOpener } from "@ionic-native/file-opener/ngx"; | |
import { File } from "@ionic-native/file/ngx"; | |
import { FileTransfer } from "@ionic-native/file-transfer/ngx"; | |
import { NgModule } from "@angular/core"; | |
import { BrowserModule } from "@angular/platform-browser"; | |
import { RouteReuseStrategy } from "@angular/router"; | |
import { IonicModule, IonicRouteStrategy } from "@ionic/angular"; | |
import { SplashScreen } from "@ionic-native/splash-screen/ngx"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount() { | |
this.socket = new WebSocket(ConfigData.url); | |
this.socket.onmessage = event => { | |
let Data = JSON.parse(event.data); | |
Data.forEach(([name, price]) => { | |
... | |
}); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Data.forEach(([name, price]) => { | |
this.setState(prevstate => ({ | |
data: { | |
...prevstate.data, | |
[name]: | |
} | |
})); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
const { data } = this.state; | |
return ( | |
<div className="App"> | |
<h2>Hello world</h2> | |
{Object.keys(data).map((key, index) => ( | |
<div key={index}> | |
<div>{key}</div> | |
<div>{data[key]}</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
module.exports = [ | |
{ | |
entry: { | |
client: "./src/client/index.js" | |
}, | |
output: { | |
path: path.resolve(__dirname, "dist"), | |
filename: "[name].js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
const app = express() | |
const port = 3000 | |
app.get('/', (req, res) => res.send('Hello World!')) | |
app.listen(port, () => console.log(`Example app listening on port ${port}!`)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"start": "npm-run-all --parallel watch:build watch:server", | |
"watch:build": "webpack --watch", | |
"watch:server": "nodemon \"./server.js\" --watch \"./ \"" | |
}, |
OlderNewer