├── EscPosDemo ├── src │ ├── app │ │ ├── app.component.scss │ │ ├── tab2 │ │ │ ├── tab2.page.scss │ │ │ ├── tab2-routing.module.ts │ │ │ ├── tab2.page.html │ │ │ ├── tab2.module.ts │ │ │ ├── tab2.page.spec.ts │ │ │ └── tab2.page.ts │ │ ├── tab3 │ │ │ ├── tab3.page.scss │ │ │ ├── tab3-routing.module.ts │ │ │ ├── tab3.page.html │ │ │ ├── tab3.module.ts │ │ │ ├── tab3.page.spec.ts │ │ │ └── tab3.page.ts │ │ ├── tabs │ │ │ ├── tabs.page.scss │ │ │ ├── tabs.page.ts │ │ │ ├── tabs.module.ts │ │ │ ├── tabs.page.html │ │ │ ├── tabs.page.spec.ts │ │ │ └── tabs-routing.module.ts │ │ ├── app.component.html │ │ ├── explore-container │ │ │ ├── explore-container.component.html │ │ │ ├── explore-container.component.ts │ │ │ ├── explore-container.component.scss │ │ │ ├── explore-container.module.ts │ │ │ └── explore-container.component.spec.ts │ │ ├── tab1 │ │ │ ├── tab1.page.ts │ │ │ ├── tab1-routing.module.ts │ │ │ ├── tab1.page.scss │ │ │ ├── tab1.page.html │ │ │ ├── tab1.module.ts │ │ │ └── tab1.page.spec.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── app.component.spec.ts │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── assets │ │ ├── icon │ │ │ └── favicon.png │ │ └── shapes.svg │ ├── zone-flags.ts │ ├── main.ts │ ├── test.ts │ ├── index.html │ ├── global.scss │ ├── polyfills.ts │ └── theme │ │ └── variables.scss ├── resources │ ├── icon.png │ ├── splash.png │ ├── ios │ │ ├── icon │ │ │ ├── icon.png │ │ │ ├── icon-20.png │ │ │ ├── icon-29.png │ │ │ ├── icon-40.png │ │ │ ├── icon-50.png │ │ │ ├── icon-60.png │ │ │ ├── icon-72.png │ │ │ ├── icon-76.png │ │ │ ├── icon@2x.png │ │ │ ├── icon-1024.png │ │ │ ├── icon-20@2x.png │ │ │ ├── icon-20@3x.png │ │ │ ├── icon-24@2x.png │ │ │ ├── icon-27.5@2x.png │ │ │ ├── icon-29@2x.png │ │ │ ├── icon-29@3x.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-40@3x.png │ │ │ ├── icon-44@2x.png │ │ │ ├── icon-50@2x.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-60@3x.png │ │ │ ├── icon-72@2x.png │ │ │ ├── icon-76@2x.png │ │ │ ├── icon-83.5@2x.png │ │ │ ├── icon-86@2x.png │ │ │ ├── icon-98@2x.png │ │ │ ├── icon-small.png │ │ │ ├── icon-small@2x.png │ │ │ └── icon-small@3x.png │ │ └── splash │ │ │ ├── Default-667h.png │ │ │ ├── Default-736h.png │ │ │ ├── Default-2436h.png │ │ │ ├── Default~iphone.png │ │ │ ├── Default@2x~iphone.png │ │ │ ├── Default-568h@2x~iphone.png │ │ │ ├── Default-Landscape-736h.png │ │ │ ├── Default-Landscape~ipad.png │ │ │ ├── Default-Portrait~ipad.png │ │ │ ├── Default-Landscape-2436h.png │ │ │ ├── Default-Landscape@2x~ipad.png │ │ │ ├── Default-Portrait@2x~ipad.png │ │ │ ├── Default-Portrait@~ipadpro.png │ │ │ ├── Default-Landscape@~ipadpro.png │ │ │ └── Default@2x~universal~anyany.png │ ├── android │ │ ├── icon │ │ │ ├── drawable-hdpi-icon.png │ │ │ ├── drawable-ldpi-icon.png │ │ │ ├── drawable-mdpi-icon.png │ │ │ ├── drawable-xhdpi-icon.png │ │ │ ├── drawable-xxhdpi-icon.png │ │ │ └── drawable-xxxhdpi-icon.png │ │ ├── splash │ │ │ ├── drawable-land-hdpi-screen.png │ │ │ ├── drawable-land-ldpi-screen.png │ │ │ ├── drawable-land-mdpi-screen.png │ │ │ ├── drawable-land-xhdpi-screen.png │ │ │ ├── drawable-port-hdpi-screen.png │ │ │ ├── drawable-port-ldpi-screen.png │ │ │ ├── drawable-port-mdpi-screen.png │ │ │ ├── drawable-port-xhdpi-screen.png │ │ │ ├── drawable-land-xxhdpi-screen.png │ │ │ ├── drawable-land-xxxhdpi-screen.png │ │ │ ├── drawable-port-xxhdpi-screen.png │ │ │ └── drawable-port-xxxhdpi-screen.png │ │ └── xml │ │ │ └── network_security_config.xml │ └── README.md ├── ionic.config.json ├── e2e │ ├── src │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ ├── tsconfig.json │ └── protractor.conf.js ├── tsconfig.spec.json ├── tsconfig.app.json ├── browserslist ├── .gitignore ├── tsconfig.json ├── karma.conf.js ├── package.json ├── tslint.json ├── angular.json └── config.xml ├── README.md ├── esc-pos-demo-ws.code-workspace └── LICENSE /EscPosDemo/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab2/tab2.page.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab3/tab3.page.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tabs/tabs.page.scss: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /EscPosDemo/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /EscPosDemo/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/icon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/splash.png -------------------------------------------------------------------------------- /EscPosDemo/ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EscPosDemo", 3 | "integrations": { 4 | "cordova": {} 5 | }, 6 | "type": "angular" 7 | } 8 | -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /EscPosDemo/src/assets/icon/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/src/assets/icon/favicon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-20.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-29.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-1024.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-20@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-20@3x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-24@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-24@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-27.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-27.5@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-29@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-29@3x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-40@3x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-44@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-44@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-83.5@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-86@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-86@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-98@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-98@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-2436h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-2436h.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Landscape-2436h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Landscape-2436h.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Portrait@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Portrait@~ipadpro.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default-Landscape@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default-Landscape@~ipadpro.png -------------------------------------------------------------------------------- /EscPosDemo/resources/ios/splash/Default@2x~universal~anyany.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/ios/splash/Default@2x~universal~anyany.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/src/zone-flags.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Prevents Angular change detection from 3 | * running with certain Web Component callbacks 4 | */ 5 | (window as any).__Zone_disable_customElements = true; 6 | -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ansontio/esc-pos-encoder-ionic-demo/HEAD/EscPosDemo/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /EscPosDemo/src/app/explore-container/explore-container.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{ name }} 3 |

Explore UI Components

4 |
-------------------------------------------------------------------------------- /EscPosDemo/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getPageTitle() { 9 | return element(by.css('ion-title')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab1/tab1.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-tab1', 5 | templateUrl: 'tab1.page.html', 6 | styleUrls: ['tab1.page.scss'] 7 | }) 8 | export class Tab1Page { 9 | 10 | constructor() {} 11 | 12 | } 13 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tabs/tabs.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-tabs', 5 | templateUrl: 'tabs.page.html', 6 | styleUrls: ['tabs.page.scss'] 7 | }) 8 | export class TabsPage { 9 | 10 | constructor() {} 11 | 12 | } 13 | -------------------------------------------------------------------------------- /EscPosDemo/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /EscPosDemo/resources/android/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | localhost 5 | 6 | 7 | -------------------------------------------------------------------------------- /EscPosDemo/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('new App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getPageTitle()).toContain('Tab 1'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /EscPosDemo/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } -------------------------------------------------------------------------------- /EscPosDemo/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.ts", 13 | "src/**/*.d.ts" 14 | ], 15 | "exclude": [ 16 | "src/**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /EscPosDemo/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab1/tab1-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { Tab1Page } from './tab1.page'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', 8 | component: Tab1Page, 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class Tab1PageRoutingModule {} 17 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab2/tab2-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { Tab2Page } from './tab2.page'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', 8 | component: Tab2Page, 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class Tab2PageRoutingModule {} 17 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab3/tab3-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { Tab3Page } from './tab3.page'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', 8 | component: Tab3Page, 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class Tab3PageRoutingModule {} 17 | -------------------------------------------------------------------------------- /EscPosDemo/resources/README.md: -------------------------------------------------------------------------------- 1 | These are Cordova resources. You can replace icon.png and splash.png and run 2 | `ionic cordova resources` to generate custom icons and splash screens for your 3 | app. See `ionic cordova resources --help` for details. 4 | 5 | Cordova reference documentation: 6 | 7 | - Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html 8 | - Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/ 9 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/explore-container/explore-container.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-explore-container', 5 | templateUrl: './explore-container.component.html', 6 | styleUrls: ['./explore-container.component.scss'], 7 | }) 8 | export class ExploreContainerComponent implements OnInit { 9 | @Input() name: string; 10 | 11 | constructor() { } 12 | 13 | ngOnInit() {} 14 | 15 | } 16 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab1/tab1.page.scss: -------------------------------------------------------------------------------- 1 | #container { 2 | text-align: center; 3 | 4 | position: absolute; 5 | left: 0; 6 | right: 0; 7 | top: 50%; 8 | transform: translateY(-50%); 9 | } 10 | 11 | #container strong { 12 | font-size: 20px; 13 | line-height: 26px; 14 | } 15 | 16 | #container p { 17 | font-size: 16px; 18 | line-height: 22px; 19 | 20 | color: #8c8c8c; 21 | 22 | margin: 0; 23 | } 24 | 25 | #container a { 26 | text-decoration: none; 27 | } 28 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab2/tab2.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tab 2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Tab 2 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab3/tab3.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tab 3 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Tab 3 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /EscPosDemo/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. 13 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/explore-container/explore-container.component.scss: -------------------------------------------------------------------------------- 1 | #container { 2 | text-align: center; 3 | 4 | position: absolute; 5 | left: 0; 6 | right: 0; 7 | top: 50%; 8 | transform: translateY(-50%); 9 | } 10 | 11 | #container strong { 12 | font-size: 20px; 13 | line-height: 26px; 14 | } 15 | 16 | #container p { 17 | font-size: 16px; 18 | line-height: 22px; 19 | 20 | color: #8c8c8c; 21 | 22 | margin: 0; 23 | } 24 | 25 | #container a { 26 | text-decoration: none; 27 | } -------------------------------------------------------------------------------- /EscPosDemo/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | { 6 | path: '', 7 | loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) 8 | } 9 | ]; 10 | @NgModule({ 11 | imports: [ 12 | RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) 13 | ], 14 | exports: [RouterModule] 15 | }) 16 | export class AppRoutingModule {} 17 | -------------------------------------------------------------------------------- /EscPosDemo/.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies intentionally untracked files to ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | .tmp 7 | *.tmp 8 | *.tmp.* 9 | *.sublime-project 10 | *.sublime-workspace 11 | .DS_Store 12 | Thumbs.db 13 | UserInterfaceState.xcuserstate 14 | $RECYCLE.BIN/ 15 | 16 | *.log 17 | log.txt 18 | npm-debug.log* 19 | 20 | /.idea 21 | /.ionic 22 | /.sass-cache 23 | /.sourcemaps 24 | /.versions 25 | /.vscode 26 | /coverage 27 | /dist 28 | /node_modules 29 | /platforms 30 | /plugins 31 | /www 32 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tabs/tabs.module.ts: -------------------------------------------------------------------------------- 1 | import { IonicModule } from '@ionic/angular'; 2 | import { NgModule } from '@angular/core'; 3 | import { CommonModule } from '@angular/common'; 4 | import { FormsModule } from '@angular/forms'; 5 | 6 | import { TabsPageRoutingModule } from './tabs-routing.module'; 7 | 8 | import { TabsPage } from './tabs.page'; 9 | 10 | @NgModule({ 11 | imports: [ 12 | IonicModule, 13 | CommonModule, 14 | FormsModule, 15 | TabsPageRoutingModule 16 | ], 17 | declarations: [TabsPage] 18 | }) 19 | export class TabsPageModule {} 20 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/explore-container/explore-container.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { IonicModule } from '@ionic/angular'; 6 | 7 | import { ExploreContainerComponent } from './explore-container.component'; 8 | 9 | @NgModule({ 10 | imports: [ CommonModule, FormsModule, IonicModule], 11 | declarations: [ExploreContainerComponent], 12 | exports: [ExploreContainerComponent] 13 | }) 14 | export class ExploreContainerComponentModule {} 15 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tabs/tabs.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tab 1 6 | 7 | 8 | 9 | 10 | Tab 2 11 | 12 | 13 | 14 | 15 | Test Print Immediately 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /EscPosDemo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "esnext", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "lib": [ 15 | "es2018", 16 | "dom" 17 | ] 18 | }, 19 | "angularCompilerOptions": { 20 | "fullTemplateTypeCheck": true, 21 | "strictInjectionParameters": true 22 | } 23 | } -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab1/tab1.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Tab 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | Tab 1 11 | 12 | 13 | 14 |
15 | Hello 16 |

A Demo application to print from Ionic 5 into thermal printer.

17 |

To test print via bluetooth connection, navigate to Tab 2

18 |

To test print via ethernet connection, navigate to Tab 3

19 |
20 |
21 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab1/tab1.module.ts: -------------------------------------------------------------------------------- 1 | import { IonicModule } from '@ionic/angular'; 2 | import { NgModule } from '@angular/core'; 3 | import { CommonModule } from '@angular/common'; 4 | import { FormsModule } from '@angular/forms'; 5 | import { Tab1Page } from './tab1.page'; 6 | import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; 7 | 8 | import { Tab1PageRoutingModule } from './tab1-routing.module'; 9 | 10 | @NgModule({ 11 | imports: [ 12 | IonicModule, 13 | CommonModule, 14 | FormsModule, 15 | ExploreContainerComponentModule, 16 | Tab1PageRoutingModule 17 | ], 18 | declarations: [Tab1Page] 19 | }) 20 | export class Tab1PageModule {} 21 | -------------------------------------------------------------------------------- /EscPosDemo/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab2/tab2.module.ts: -------------------------------------------------------------------------------- 1 | import { IonicModule } from '@ionic/angular'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NgModule } from '@angular/core'; 4 | import { CommonModule } from '@angular/common'; 5 | import { FormsModule } from '@angular/forms'; 6 | import { Tab2Page } from './tab2.page'; 7 | import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; 8 | 9 | import { Tab2PageRoutingModule } from './tab2-routing.module'; 10 | 11 | @NgModule({ 12 | imports: [ 13 | IonicModule, 14 | CommonModule, 15 | FormsModule, 16 | ExploreContainerComponentModule, 17 | Tab2PageRoutingModule 18 | ], 19 | declarations: [Tab2Page] 20 | }) 21 | export class Tab2PageModule {} 22 | -------------------------------------------------------------------------------- /EscPosDemo/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { Platform } from '@ionic/angular'; 4 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 5 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | templateUrl: 'app.component.html', 10 | styleUrls: ['app.component.scss'] 11 | }) 12 | export class AppComponent { 13 | constructor( 14 | private platform: Platform, 15 | private splashScreen: SplashScreen, 16 | private statusBar: StatusBar 17 | ) { 18 | this.initializeApp(); 19 | } 20 | 21 | initializeApp() { 22 | this.platform.ready().then(() => { 23 | this.statusBar.styleDefault(); 24 | this.splashScreen.hide(); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tabs/tabs.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | 4 | import { TabsPage } from './tabs.page'; 5 | 6 | describe('TabsPage', () => { 7 | let component: TabsPage; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach(async(() => { 11 | TestBed.configureTestingModule({ 12 | declarations: [TabsPage], 13 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 14 | }).compileComponents(); 15 | })); 16 | 17 | beforeEach(() => { 18 | fixture = TestBed.createComponent(TabsPage); 19 | component = fixture.componentInstance; 20 | fixture.detectChanges(); 21 | }); 22 | 23 | it('should create', () => { 24 | expect(component).toBeTruthy(); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab3/tab3.module.ts: -------------------------------------------------------------------------------- 1 | import { IonicModule } from '@ionic/angular'; 2 | import { RouterModule } from '@angular/router'; 3 | import { NgModule } from '@angular/core'; 4 | import { CommonModule } from '@angular/common'; 5 | import { FormsModule } from '@angular/forms'; 6 | import { Tab3Page } from './tab3.page'; 7 | import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; 8 | 9 | import { Tab3PageRoutingModule } from './tab3-routing.module' 10 | 11 | @NgModule({ 12 | imports: [ 13 | IonicModule, 14 | CommonModule, 15 | FormsModule, 16 | ExploreContainerComponentModule, 17 | RouterModule.forChild([{ path: '', component: Tab3Page }]), 18 | Tab3PageRoutingModule, 19 | ], 20 | declarations: [Tab3Page] 21 | }) 22 | export class Tab3PageModule {} 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESC Pos Encoder Demo (Ionic 5) 2 | 3 | A simple ionic 5 demo application to show printing capability into thermal printer by sending a byte code stream into the printer. 4 | 5 | ## Notes 6 | 7 | - Only works on Android / iOS device 8 | - Tested on Epson thermal printer TM-T82 9 | - Works on: 10 | - Bluetooth connection 11 | - Ethernet connection 12 | 13 | ## Library 14 | 15 | - [ESC Pos Encoder Ionic ](https://github.com/Ans0n-Ti0/EscPosEncoder) 16 | - [Cordova Socket TCP/IP](https://github.com/blocshop/sockets-for-cordova) 17 | - [Bluetooth Serial](https://ionicframework.com/docs/native/bluetooth-serial) 18 | 19 | ## Guide 20 | 21 | - `git clone https://github.com/Ans0n-Ti0/esc-pos-encoder-ionic-demo` 22 | - navigate into project folder 23 | - `npm install` 24 | - `ionic cordova platform add android` 25 | - `ionic cordova run android` 26 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { RouteReuseStrategy } from '@angular/router'; 4 | 5 | import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; 6 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 7 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 8 | 9 | import { AppRoutingModule } from './app-routing.module'; 10 | import { AppComponent } from './app.component'; 11 | 12 | @NgModule({ 13 | declarations: [AppComponent], 14 | entryComponents: [], 15 | imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule], 16 | providers: [ 17 | StatusBar, 18 | SplashScreen, 19 | { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } 20 | ], 21 | bootstrap: [AppComponent] 22 | }) 23 | export class AppModule {} 24 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab1/tab1.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { IonicModule } from '@ionic/angular'; 3 | import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; 4 | 5 | import { Tab1Page } from './tab1.page'; 6 | 7 | describe('Tab1Page', () => { 8 | let component: Tab1Page; 9 | let fixture: ComponentFixture; 10 | 11 | beforeEach(async(() => { 12 | TestBed.configureTestingModule({ 13 | declarations: [Tab1Page], 14 | imports: [IonicModule.forRoot(), ExploreContainerComponentModule] 15 | }).compileComponents(); 16 | 17 | fixture = TestBed.createComponent(Tab1Page); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | })); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab2/tab2.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { IonicModule } from '@ionic/angular'; 3 | import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; 4 | 5 | import { Tab2Page } from './tab2.page'; 6 | 7 | describe('Tab2Page', () => { 8 | let component: Tab2Page; 9 | let fixture: ComponentFixture; 10 | 11 | beforeEach(async(() => { 12 | TestBed.configureTestingModule({ 13 | declarations: [Tab2Page], 14 | imports: [IonicModule.forRoot(), ExploreContainerComponentModule] 15 | }).compileComponents(); 16 | 17 | fixture = TestBed.createComponent(Tab2Page); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | })); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab3/tab3.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { IonicModule } from '@ionic/angular'; 3 | import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; 4 | 5 | import { Tab3Page } from './tab3.page'; 6 | 7 | describe('Tab3Page', () => { 8 | let component: Tab3Page; 9 | let fixture: ComponentFixture; 10 | 11 | beforeEach(async(() => { 12 | TestBed.configureTestingModule({ 13 | declarations: [Tab3Page], 14 | imports: [IonicModule.forRoot(), ExploreContainerComponentModule] 15 | }).compileComponents(); 16 | 17 | fixture = TestBed.createComponent(Tab3Page); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | })); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/explore-container/explore-container.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { IonicModule } from '@ionic/angular'; 3 | 4 | import { ExploreContainerComponent } from './explore-container.component'; 5 | 6 | describe('ExploreContainerComponent', () => { 7 | let component: ExploreContainerComponent; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach(async(() => { 11 | TestBed.configureTestingModule({ 12 | declarations: [ ExploreContainerComponent ], 13 | imports: [IonicModule.forRoot()] 14 | }).compileComponents(); 15 | 16 | fixture = TestBed.createComponent(ExploreContainerComponent); 17 | component = fixture.componentInstance; 18 | fixture.detectChanges(); 19 | })); 20 | 21 | it('should create', () => { 22 | expect(component).toBeTruthy(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /esc-pos-demo-ws.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "EscPosDemo" 5 | } 6 | ], 7 | "settings": { 8 | "workbench.colorCustomizations": { 9 | "activityBar.activeBackground": "#65c89b", 10 | "activityBar.activeBorder": "#945bc4", 11 | "activityBar.background": "#65c89b", 12 | "activityBar.foreground": "#15202b", 13 | "activityBar.inactiveForeground": "#15202b99", 14 | "activityBarBadge.background": "#945bc4", 15 | "activityBarBadge.foreground": "#e7e7e7", 16 | "statusBar.background": "#42b883", 17 | "statusBar.foreground": "#15202b", 18 | "statusBarItem.hoverBackground": "#359268", 19 | "titleBar.activeBackground": "#42b883", 20 | "titleBar.activeForeground": "#15202b", 21 | "titleBar.inactiveBackground": "#42b88399", 22 | "titleBar.inactiveForeground": "#15202b99" 23 | }, 24 | "peacock.color": "#42b883" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /EscPosDemo/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ 31 | spec: { 32 | displayStacktrace: StacktraceOption.PRETTY 33 | } 34 | })); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /EscPosDemo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ionic App 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tabs/tabs-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { TabsPage } from './tabs.page'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: 'tabs', 8 | component: TabsPage, 9 | children: [ 10 | { 11 | path: 'tab1', 12 | loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule) 13 | }, 14 | { 15 | path: 'tab2', 16 | loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule) 17 | }, 18 | { 19 | path: 'tab3', 20 | loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule) 21 | }, 22 | { 23 | path: '', 24 | redirectTo: '/tabs/tab1', 25 | pathMatch: 'full' 26 | } 27 | ] 28 | }, 29 | { 30 | path: '', 31 | redirectTo: '/tabs/tab1', 32 | pathMatch: 'full' 33 | } 34 | ]; 35 | 36 | @NgModule({ 37 | imports: [RouterModule.forChild(routes)], 38 | exports: [RouterModule] 39 | }) 40 | export class TabsPageRoutingModule {} 41 | -------------------------------------------------------------------------------- /EscPosDemo/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Anson Tio 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /EscPosDemo/src/assets/shapes.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /EscPosDemo/src/global.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * App Global CSS 3 | * ---------------------------------------------------------------------------- 4 | * Put style rules here that you want to apply globally. These styles are for 5 | * the entire app and not just one component. Additionally, this file can be 6 | * used as an entry point to import other CSS/Sass files to be included in the 7 | * output CSS. 8 | * For more information on global stylesheets, visit the documentation: 9 | * https://ionicframework.com/docs/layout/global-stylesheets 10 | */ 11 | 12 | /* Core CSS required for Ionic components to work properly */ 13 | @import "~@ionic/angular/css/core.css"; 14 | 15 | /* Basic CSS for apps built with Ionic */ 16 | @import "~@ionic/angular/css/normalize.css"; 17 | @import "~@ionic/angular/css/structure.css"; 18 | @import "~@ionic/angular/css/typography.css"; 19 | @import '~@ionic/angular/css/display.css'; 20 | 21 | /* Optional CSS utils that can be commented out */ 22 | @import "~@ionic/angular/css/padding.css"; 23 | @import "~@ionic/angular/css/float-elements.css"; 24 | @import "~@ionic/angular/css/text-alignment.css"; 25 | @import "~@ionic/angular/css/text-transformation.css"; 26 | @import "~@ionic/angular/css/flex-utils.css"; 27 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab3/tab3.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import EscPosEncoder from 'esc-pos-encoder-ionic'; 3 | 4 | declare var Socket: any; 5 | 6 | @Component({ 7 | selector: 'app-tab3', 8 | templateUrl: 'tab3.page.html', 9 | styleUrls: ['tab3.page.scss'], 10 | }) 11 | export class Tab3Page { 12 | // * Set your variable here 13 | IP = '192.168.100.89'; 14 | PORT = '9100'; 15 | // * End 16 | 17 | constructor() {} 18 | 19 | ionViewDidEnter() { 20 | // For POC purposes only 21 | this.testPrint(); 22 | } 23 | 24 | /** 25 | * 26 | */ 27 | testPrint() { 28 | const socket = new Socket(); 29 | 30 | // socket receive bytecode, therefore we need to create a byte stream by using esc-pos-encoder-ionic 31 | const encoder = new EscPosEncoder(); 32 | const result = encoder.initialize(); 33 | 34 | result 35 | .align('center') 36 | .newline() 37 | .line('Congratulation, print success') 38 | .line('IP : ' + this.IP) 39 | .line('Port : ' + this.PORT) 40 | .newline() 41 | .newline() 42 | .newline() 43 | .newline() 44 | .newline() 45 | .newline() 46 | .cut(); 47 | 48 | const resultByte = result.encode(); 49 | 50 | // send byte code into the printer 51 | socket.open( 52 | this.IP, 53 | this.PORT, 54 | () => { 55 | socket.write(resultByte, () => { 56 | socket.shutdownWrite(); 57 | }); 58 | }, 59 | (err) => { 60 | console.error(err); 61 | } 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/tab2/tab2.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { BluetoothSerial } from '@ionic-native/bluetooth-serial'; 3 | import EscPosEncoder from 'esc-pos-encoder-ionic'; 4 | 5 | @Component({ 6 | selector: 'app-tab2', 7 | templateUrl: 'tab2.page.html', 8 | styleUrls: ['tab2.page.scss'], 9 | }) 10 | export class Tab2Page { 11 | // * Set your variable here 12 | MAC = '00:0a:95:9d:68:16'; // this is bluetooth printer mac address 13 | // * End 14 | 15 | constructor() {} 16 | 17 | ionViewDidEnter() { 18 | // For POC purposes only 19 | this.testPrintViaBluetooth(); 20 | } 21 | 22 | /** 23 | * 24 | */ 25 | testPrintViaBluetooth() { 26 | // socket receive bytecode, therefore we need to create a byte stream by using esc-pos-encoder-ionic 27 | const encoder = new EscPosEncoder(); 28 | const result = encoder.initialize(); 29 | 30 | result 31 | .align('center') 32 | .newline() 33 | .line('Congratulation, print success') 34 | .line('Bluetooth MAC : ' + this.MAC) 35 | .newline() 36 | .newline() 37 | .newline() 38 | .newline() 39 | .newline() 40 | .newline() 41 | .cut(); 42 | 43 | const resultByte = result.encode(); 44 | 45 | // send byte code into the printer 46 | BluetoothSerial.connect(this.MAC).subscribe(() => { 47 | BluetoothSerial.write(resultByte) 48 | .then(() => { 49 | console.log('Print success'); 50 | }) 51 | .catch((err) => { 52 | console.error(err); 53 | }); 54 | }); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /EscPosDemo/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { TestBed, async } from '@angular/core/testing'; 3 | 4 | import { Platform } from '@ionic/angular'; 5 | import { SplashScreen } from '@ionic-native/splash-screen/ngx'; 6 | import { StatusBar } from '@ionic-native/status-bar/ngx'; 7 | 8 | import { AppComponent } from './app.component'; 9 | 10 | describe('AppComponent', () => { 11 | 12 | let statusBarSpy; 13 | let splashScreenSpy; 14 | let platformReadySpy; 15 | let platformSpy; 16 | 17 | beforeEach(async(() => { 18 | statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']); 19 | splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']); 20 | platformReadySpy = Promise.resolve(); 21 | platformSpy = jasmine.createSpyObj('Platform', { ready: platformReadySpy }); 22 | 23 | TestBed.configureTestingModule({ 24 | declarations: [AppComponent], 25 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 26 | providers: [ 27 | { provide: StatusBar, useValue: statusBarSpy }, 28 | { provide: SplashScreen, useValue: splashScreenSpy }, 29 | { provide: Platform, useValue: platformSpy }, 30 | ], 31 | }).compileComponents(); 32 | })); 33 | 34 | it('should create the app', () => { 35 | const fixture = TestBed.createComponent(AppComponent); 36 | const app = fixture.debugElement.componentInstance; 37 | expect(app).toBeTruthy(); 38 | }); 39 | 40 | it('should initialize the app', async () => { 41 | TestBed.createComponent(AppComponent); 42 | expect(platformSpy.ready).toHaveBeenCalled(); 43 | await platformReadySpy; 44 | expect(statusBarSpy.styleDefault).toHaveBeenCalled(); 45 | expect(splashScreenSpy.hide).toHaveBeenCalled(); 46 | }); 47 | 48 | // TODO: add more tests! 49 | 50 | }); 51 | -------------------------------------------------------------------------------- /EscPosDemo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EscPosDemo", 3 | "version": "0.0.1", 4 | "author": "Ionic Framework", 5 | "homepage": "https://ionicframework.com/", 6 | "scripts": { 7 | "ng": "ng", 8 | "start": "ng serve", 9 | "build": "ng build", 10 | "test": "ng test", 11 | "lint": "ng lint", 12 | "e2e": "ng e2e" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/common": "~10.0.0", 17 | "@angular/core": "~10.0.0", 18 | "@angular/forms": "~10.0.0", 19 | "@angular/platform-browser": "~10.0.0", 20 | "@angular/platform-browser-dynamic": "~10.0.0", 21 | "@angular/router": "~10.0.0", 22 | "@ionic-native/bluetooth-serial": "^5.29.0", 23 | "@ionic-native/core": "^5.0.0", 24 | "@ionic-native/splash-screen": "^5.0.0", 25 | "@ionic-native/status-bar": "^5.0.0", 26 | "@ionic/angular": "^5.0.0", 27 | "cordova-android": "^8.1.0", 28 | "cordova-plugin-bluetooth-serial": "^0.4.7", 29 | "cz.blocshop.socketsforcordova": "^1.1.0", 30 | "esc-pos-encoder-ionic": "^1.1.3", 31 | "rxjs": "~6.5.5", 32 | "tslib": "^2.0.0", 33 | "zone.js": "~0.10.3" 34 | }, 35 | "devDependencies": { 36 | "@angular-devkit/build-angular": "~0.1000.0", 37 | "@angular/cli": "~10.0.5", 38 | "@angular/compiler": "~10.0.0", 39 | "@angular/compiler-cli": "~10.0.0", 40 | "@angular/language-service": "~10.0.0", 41 | "@ionic/angular-toolkit": "^2.3.0", 42 | "@types/jasmine": "~3.5.0", 43 | "@types/jasminewd2": "~2.0.3", 44 | "@types/node": "^12.11.1", 45 | "codelyzer": "^6.0.0", 46 | "cordova-plugin-device": "^2.0.2", 47 | "cordova-plugin-ionic-keyboard": "^2.2.0", 48 | "cordova-plugin-ionic-webview": "^4.2.1", 49 | "cordova-plugin-splashscreen": "^5.0.2", 50 | "cordova-plugin-statusbar": "^2.4.2", 51 | "cordova-plugin-whitelist": "^1.3.3", 52 | "jasmine-core": "~3.5.0", 53 | "jasmine-spec-reporter": "~5.0.0", 54 | "karma": "~5.0.0", 55 | "karma-chrome-launcher": "~3.1.0", 56 | "karma-coverage-istanbul-reporter": "~3.0.2", 57 | "karma-jasmine": "~3.3.0", 58 | "karma-jasmine-html-reporter": "^1.5.0", 59 | "protractor": "~7.0.0", 60 | "ts-node": "~8.3.0", 61 | "tslint": "~6.1.0", 62 | "typescript": "~3.9.5" 63 | }, 64 | "description": "An Ionic project", 65 | "cordova": { 66 | "plugins": { 67 | "cordova-plugin-whitelist": {}, 68 | "cordova-plugin-statusbar": {}, 69 | "cordova-plugin-device": {}, 70 | "cordova-plugin-splashscreen": {}, 71 | "cordova-plugin-ionic-webview": { 72 | "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+" 73 | }, 74 | "cordova-plugin-ionic-keyboard": {}, 75 | "cz.blocshop.socketsforcordova": {}, 76 | "cordova-plugin-bluetooth-serial": {} 77 | }, 78 | "platforms": [ 79 | "android" 80 | ] 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /EscPosDemo/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | import './zone-flags'; 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | 61 | import 'zone.js/dist/zone'; // Included with Angular CLI. 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | -------------------------------------------------------------------------------- /EscPosDemo/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "align": { 5 | "options": [ 6 | "parameters", 7 | "statements" 8 | ] 9 | }, 10 | "array-type": false, 11 | "arrow-return-shorthand": true, 12 | "curly": true, 13 | "deprecation": { 14 | "severity": "warning" 15 | }, 16 | "component-class-suffix": [true, "Page", "Component"], 17 | "contextual-lifecycle": true, 18 | "directive-class-suffix": true, 19 | "directive-selector": [ 20 | true, 21 | "attribute", 22 | "app", 23 | "camelCase" 24 | ], 25 | "component-selector": [ 26 | true, 27 | "element", 28 | "app", 29 | "kebab-case" 30 | ], 31 | "eofline": true, 32 | "import-blacklist": [ 33 | true, 34 | "rxjs/Rx" 35 | ], 36 | "import-spacing": true, 37 | "indent": { 38 | "options": [ 39 | "spaces" 40 | ] 41 | }, 42 | "max-classes-per-file": false, 43 | "max-line-length": [ 44 | true, 45 | 140 46 | ], 47 | "member-ordering": [ 48 | true, 49 | { 50 | "order": [ 51 | "static-field", 52 | "instance-field", 53 | "static-method", 54 | "instance-method" 55 | ] 56 | } 57 | ], 58 | "no-console": [ 59 | true, 60 | "debug", 61 | "info", 62 | "time", 63 | "timeEnd", 64 | "trace" 65 | ], 66 | "no-empty": false, 67 | "no-inferrable-types": [ 68 | true, 69 | "ignore-params" 70 | ], 71 | "no-non-null-assertion": true, 72 | "no-redundant-jsdoc": true, 73 | "no-switch-case-fall-through": true, 74 | "no-var-requires": false, 75 | "object-literal-key-quotes": [ 76 | true, 77 | "as-needed" 78 | ], 79 | "quotemark": [ 80 | true, 81 | "single" 82 | ], 83 | "semicolon": { 84 | "options": [ 85 | "always" 86 | ] 87 | }, 88 | "space-before-function-paren": { 89 | "options": { 90 | "anonymous": "never", 91 | "asyncArrow": "always", 92 | "constructor": "never", 93 | "method": "never", 94 | "named": "never" 95 | } 96 | }, 97 | "typedef-whitespace": { 98 | "options": [ 99 | { 100 | "call-signature": "nospace", 101 | "index-signature": "nospace", 102 | "parameter": "nospace", 103 | "property-declaration": "nospace", 104 | "variable-declaration": "nospace" 105 | }, 106 | { 107 | "call-signature": "onespace", 108 | "index-signature": "onespace", 109 | "parameter": "onespace", 110 | "property-declaration": "onespace", 111 | "variable-declaration": "onespace" 112 | } 113 | ] 114 | }, 115 | "variable-name": { 116 | "options": [ 117 | "ban-keywords", 118 | "check-format", 119 | "allow-pascal-case" 120 | ] 121 | }, 122 | "whitespace": { 123 | "options": [ 124 | "check-branch", 125 | "check-decl", 126 | "check-operator", 127 | "check-separator", 128 | "check-type", 129 | "check-typecast" 130 | ] 131 | }, 132 | "no-conflicting-lifecycle": true, 133 | "no-host-metadata-property": true, 134 | "no-input-rename": true, 135 | "no-inputs-metadata-property": true, 136 | "no-output-native": true, 137 | "no-output-on-prefix": true, 138 | "no-output-rename": true, 139 | "no-outputs-metadata-property": true, 140 | "template-banana-in-box": true, 141 | "template-no-negated-async": true, 142 | "use-lifecycle-interface": true, 143 | "use-pipe-transform-interface": true, 144 | "object-literal-sort-keys": false 145 | }, 146 | "rulesDirectory": [ 147 | "codelyzer" 148 | ] 149 | } -------------------------------------------------------------------------------- /EscPosDemo/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "defaultProject": "app", 5 | "newProjectRoot": "projects", 6 | "projects": { 7 | "app": { 8 | "root": "", 9 | "sourceRoot": "src", 10 | "projectType": "application", 11 | "prefix": "app", 12 | "schematics": {}, 13 | "architect": { 14 | "build": { 15 | "builder": "@angular-devkit/build-angular:browser", 16 | "options": { 17 | "outputPath": "www", 18 | "index": "src/index.html", 19 | "main": "src/main.ts", 20 | "polyfills": "src/polyfills.ts", 21 | "tsConfig": "tsconfig.app.json", 22 | "assets": [ 23 | { 24 | "glob": "**/*", 25 | "input": "src/assets", 26 | "output": "assets" 27 | }, 28 | { 29 | "glob": "**/*.svg", 30 | "input": "node_modules/ionicons/dist/ionicons/svg", 31 | "output": "./svg" 32 | } 33 | ], 34 | "styles": [ 35 | { 36 | "input": "src/theme/variables.scss" 37 | }, 38 | { 39 | "input": "src/global.scss" 40 | } 41 | ], 42 | "scripts": [] 43 | }, 44 | "configurations": { 45 | "production": { 46 | "fileReplacements": [ 47 | { 48 | "replace": "src/environments/environment.ts", 49 | "with": "src/environments/environment.prod.ts" 50 | } 51 | ], 52 | "optimization": true, 53 | "outputHashing": "all", 54 | "sourceMap": false, 55 | "extractCss": true, 56 | "namedChunks": false, 57 | "aot": true, 58 | "extractLicenses": true, 59 | "vendorChunk": false, 60 | "buildOptimizer": true, 61 | "budgets": [ 62 | { 63 | "type": "initial", 64 | "maximumWarning": "2mb", 65 | "maximumError": "5mb" 66 | } 67 | ] 68 | }, 69 | "ci": { 70 | "progress": false 71 | } 72 | } 73 | }, 74 | "serve": { 75 | "builder": "@angular-devkit/build-angular:dev-server", 76 | "options": { 77 | "browserTarget": "app:build" 78 | }, 79 | "configurations": { 80 | "production": { 81 | "browserTarget": "app:build:production" 82 | }, 83 | "ci": { 84 | "progress": false 85 | } 86 | } 87 | }, 88 | "extract-i18n": { 89 | "builder": "@angular-devkit/build-angular:extract-i18n", 90 | "options": { 91 | "browserTarget": "app:build" 92 | } 93 | }, 94 | "test": { 95 | "builder": "@angular-devkit/build-angular:karma", 96 | "options": { 97 | "main": "src/test.ts", 98 | "polyfills": "src/polyfills.ts", 99 | "tsConfig": "tsconfig.spec.json", 100 | "karmaConfig": "karma.conf.js", 101 | "styles": [], 102 | "scripts": [], 103 | "assets": [ 104 | { 105 | "glob": "favicon.ico", 106 | "input": "src/", 107 | "output": "/" 108 | }, 109 | { 110 | "glob": "**/*", 111 | "input": "src/assets", 112 | "output": "/assets" 113 | } 114 | ] 115 | }, 116 | "configurations": { 117 | "ci": { 118 | "progress": false, 119 | "watch": false 120 | } 121 | } 122 | }, 123 | "lint": { 124 | "builder": "@angular-devkit/build-angular:tslint", 125 | "options": { 126 | "tsConfig": [ 127 | "tsconfig.app.json", 128 | "tsconfig.spec.json", 129 | "e2e/tsconfig.json" 130 | ], 131 | "exclude": ["**/node_modules/**"] 132 | } 133 | }, 134 | "e2e": { 135 | "builder": "@angular-devkit/build-angular:protractor", 136 | "options": { 137 | "protractorConfig": "e2e/protractor.conf.js", 138 | "devServerTarget": "app:serve" 139 | }, 140 | "configurations": { 141 | "production": { 142 | "devServerTarget": "app:serve:production" 143 | }, 144 | "ci": { 145 | "devServerTarget": "app:serve:ci" 146 | } 147 | } 148 | }, 149 | "ionic-cordova-build": { 150 | "builder": "@ionic/angular-toolkit:cordova-build", 151 | "options": { 152 | "browserTarget": "app:build" 153 | }, 154 | "configurations": { 155 | "production": { 156 | "browserTarget": "app:build:production" 157 | } 158 | } 159 | }, 160 | "ionic-cordova-serve": { 161 | "builder": "@ionic/angular-toolkit:cordova-serve", 162 | "options": { 163 | "cordovaBuildTarget": "app:ionic-cordova-build", 164 | "devServerTarget": "app:serve" 165 | }, 166 | "configurations": { 167 | "production": { 168 | "cordovaBuildTarget": "app:ionic-cordova-build:production", 169 | "devServerTarget": "app:serve:production" 170 | } 171 | } 172 | } 173 | } 174 | } 175 | }, 176 | "cli": { 177 | "defaultCollection": "@ionic/angular-toolkit" 178 | }, 179 | "schematics": { 180 | "@ionic/angular-toolkit:component": { 181 | "styleext": "scss" 182 | }, 183 | "@ionic/angular-toolkit:page": { 184 | "styleext": "scss" 185 | } 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /EscPosDemo/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | MyApp 4 | An awesome Ionic/Cordova app. 5 | Ionic Framework Team 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /EscPosDemo/src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/theming/ 3 | 4 | /** Ionic CSS Variables **/ 5 | :root { 6 | /** primary **/ 7 | --ion-color-primary: #3880ff; 8 | --ion-color-primary-rgb: 56, 128, 255; 9 | --ion-color-primary-contrast: #ffffff; 10 | --ion-color-primary-contrast-rgb: 255, 255, 255; 11 | --ion-color-primary-shade: #3171e0; 12 | --ion-color-primary-tint: #4c8dff; 13 | 14 | /** secondary **/ 15 | --ion-color-secondary: #3dc2ff; 16 | --ion-color-secondary-rgb: 61, 194, 255; 17 | --ion-color-secondary-contrast: #ffffff; 18 | --ion-color-secondary-contrast-rgb: 255, 255, 255; 19 | --ion-color-secondary-shade: #36abe0; 20 | --ion-color-secondary-tint: #50c8ff; 21 | 22 | /** tertiary **/ 23 | --ion-color-tertiary: #5260ff; 24 | --ion-color-tertiary-rgb: 82, 96, 255; 25 | --ion-color-tertiary-contrast: #ffffff; 26 | --ion-color-tertiary-contrast-rgb: 255, 255, 255; 27 | --ion-color-tertiary-shade: #4854e0; 28 | --ion-color-tertiary-tint: #6370ff; 29 | 30 | /** success **/ 31 | --ion-color-success: #2dd36f; 32 | --ion-color-success-rgb: 45, 211, 111; 33 | --ion-color-success-contrast: #ffffff; 34 | --ion-color-success-contrast-rgb: 255, 255, 255; 35 | --ion-color-success-shade: #28ba62; 36 | --ion-color-success-tint: #42d77d; 37 | 38 | /** warning **/ 39 | --ion-color-warning: #ffc409; 40 | --ion-color-warning-rgb: 255, 196, 9; 41 | --ion-color-warning-contrast: #000000; 42 | --ion-color-warning-contrast-rgb: 0, 0, 0; 43 | --ion-color-warning-shade: #e0ac08; 44 | --ion-color-warning-tint: #ffca22; 45 | 46 | /** danger **/ 47 | --ion-color-danger: #eb445a; 48 | --ion-color-danger-rgb: 235, 68, 90; 49 | --ion-color-danger-contrast: #ffffff; 50 | --ion-color-danger-contrast-rgb: 255, 255, 255; 51 | --ion-color-danger-shade: #cf3c4f; 52 | --ion-color-danger-tint: #ed576b; 53 | 54 | /** dark **/ 55 | --ion-color-dark: #222428; 56 | --ion-color-dark-rgb: 34, 36, 40; 57 | --ion-color-dark-contrast: #ffffff; 58 | --ion-color-dark-contrast-rgb: 255, 255, 255; 59 | --ion-color-dark-shade: #1e2023; 60 | --ion-color-dark-tint: #383a3e; 61 | 62 | /** medium **/ 63 | --ion-color-medium: #92949c; 64 | --ion-color-medium-rgb: 146, 148, 156; 65 | --ion-color-medium-contrast: #ffffff; 66 | --ion-color-medium-contrast-rgb: 255, 255, 255; 67 | --ion-color-medium-shade: #808289; 68 | --ion-color-medium-tint: #9d9fa6; 69 | 70 | /** light **/ 71 | --ion-color-light: #f4f5f8; 72 | --ion-color-light-rgb: 244, 245, 248; 73 | --ion-color-light-contrast: #000000; 74 | --ion-color-light-contrast-rgb: 0, 0, 0; 75 | --ion-color-light-shade: #d7d8da; 76 | --ion-color-light-tint: #f5f6f9; 77 | } 78 | 79 | @media (prefers-color-scheme: dark) { 80 | /* 81 | * Dark Colors 82 | * ------------------------------------------- 83 | */ 84 | 85 | body { 86 | --ion-color-primary: #428cff; 87 | --ion-color-primary-rgb: 66,140,255; 88 | --ion-color-primary-contrast: #ffffff; 89 | --ion-color-primary-contrast-rgb: 255,255,255; 90 | --ion-color-primary-shade: #3a7be0; 91 | --ion-color-primary-tint: #5598ff; 92 | 93 | --ion-color-secondary: #50c8ff; 94 | --ion-color-secondary-rgb: 80,200,255; 95 | --ion-color-secondary-contrast: #ffffff; 96 | --ion-color-secondary-contrast-rgb: 255,255,255; 97 | --ion-color-secondary-shade: #46b0e0; 98 | --ion-color-secondary-tint: #62ceff; 99 | 100 | --ion-color-tertiary: #6a64ff; 101 | --ion-color-tertiary-rgb: 106,100,255; 102 | --ion-color-tertiary-contrast: #ffffff; 103 | --ion-color-tertiary-contrast-rgb: 255,255,255; 104 | --ion-color-tertiary-shade: #5d58e0; 105 | --ion-color-tertiary-tint: #7974ff; 106 | 107 | --ion-color-success: #2fdf75; 108 | --ion-color-success-rgb: 47,223,117; 109 | --ion-color-success-contrast: #000000; 110 | --ion-color-success-contrast-rgb: 0,0,0; 111 | --ion-color-success-shade: #29c467; 112 | --ion-color-success-tint: #44e283; 113 | 114 | --ion-color-warning: #ffd534; 115 | --ion-color-warning-rgb: 255,213,52; 116 | --ion-color-warning-contrast: #000000; 117 | --ion-color-warning-contrast-rgb: 0,0,0; 118 | --ion-color-warning-shade: #e0bb2e; 119 | --ion-color-warning-tint: #ffd948; 120 | 121 | --ion-color-danger: #ff4961; 122 | --ion-color-danger-rgb: 255,73,97; 123 | --ion-color-danger-contrast: #ffffff; 124 | --ion-color-danger-contrast-rgb: 255,255,255; 125 | --ion-color-danger-shade: #e04055; 126 | --ion-color-danger-tint: #ff5b71; 127 | 128 | --ion-color-dark: #f4f5f8; 129 | --ion-color-dark-rgb: 244,245,248; 130 | --ion-color-dark-contrast: #000000; 131 | --ion-color-dark-contrast-rgb: 0,0,0; 132 | --ion-color-dark-shade: #d7d8da; 133 | --ion-color-dark-tint: #f5f6f9; 134 | 135 | --ion-color-medium: #989aa2; 136 | --ion-color-medium-rgb: 152,154,162; 137 | --ion-color-medium-contrast: #000000; 138 | --ion-color-medium-contrast-rgb: 0,0,0; 139 | --ion-color-medium-shade: #86888f; 140 | --ion-color-medium-tint: #a2a4ab; 141 | 142 | --ion-color-light: #222428; 143 | --ion-color-light-rgb: 34,36,40; 144 | --ion-color-light-contrast: #ffffff; 145 | --ion-color-light-contrast-rgb: 255,255,255; 146 | --ion-color-light-shade: #1e2023; 147 | --ion-color-light-tint: #383a3e; 148 | } 149 | 150 | /* 151 | * iOS Dark Theme 152 | * ------------------------------------------- 153 | */ 154 | 155 | .ios body { 156 | --ion-background-color: #000000; 157 | --ion-background-color-rgb: 0,0,0; 158 | 159 | --ion-text-color: #ffffff; 160 | --ion-text-color-rgb: 255,255,255; 161 | 162 | --ion-color-step-50: #0d0d0d; 163 | --ion-color-step-100: #1a1a1a; 164 | --ion-color-step-150: #262626; 165 | --ion-color-step-200: #333333; 166 | --ion-color-step-250: #404040; 167 | --ion-color-step-300: #4d4d4d; 168 | --ion-color-step-350: #595959; 169 | --ion-color-step-400: #666666; 170 | --ion-color-step-450: #737373; 171 | --ion-color-step-500: #808080; 172 | --ion-color-step-550: #8c8c8c; 173 | --ion-color-step-600: #999999; 174 | --ion-color-step-650: #a6a6a6; 175 | --ion-color-step-700: #b3b3b3; 176 | --ion-color-step-750: #bfbfbf; 177 | --ion-color-step-800: #cccccc; 178 | --ion-color-step-850: #d9d9d9; 179 | --ion-color-step-900: #e6e6e6; 180 | --ion-color-step-950: #f2f2f2; 181 | 182 | --ion-toolbar-background: #0d0d0d; 183 | 184 | --ion-item-background: #000000; 185 | 186 | --ion-card-background: #1c1c1d; 187 | } 188 | 189 | 190 | /* 191 | * Material Design Dark Theme 192 | * ------------------------------------------- 193 | */ 194 | 195 | .md body { 196 | --ion-background-color: #121212; 197 | --ion-background-color-rgb: 18,18,18; 198 | 199 | --ion-text-color: #ffffff; 200 | --ion-text-color-rgb: 255,255,255; 201 | 202 | --ion-border-color: #222222; 203 | 204 | --ion-color-step-50: #1e1e1e; 205 | --ion-color-step-100: #2a2a2a; 206 | --ion-color-step-150: #363636; 207 | --ion-color-step-200: #414141; 208 | --ion-color-step-250: #4d4d4d; 209 | --ion-color-step-300: #595959; 210 | --ion-color-step-350: #656565; 211 | --ion-color-step-400: #717171; 212 | --ion-color-step-450: #7d7d7d; 213 | --ion-color-step-500: #898989; 214 | --ion-color-step-550: #949494; 215 | --ion-color-step-600: #a0a0a0; 216 | --ion-color-step-650: #acacac; 217 | --ion-color-step-700: #b8b8b8; 218 | --ion-color-step-750: #c4c4c4; 219 | --ion-color-step-800: #d0d0d0; 220 | --ion-color-step-850: #dbdbdb; 221 | --ion-color-step-900: #e7e7e7; 222 | --ion-color-step-950: #f3f3f3; 223 | 224 | --ion-item-background: #1e1e1e; 225 | 226 | --ion-toolbar-background: #1f1f1f; 227 | 228 | --ion-tab-bar-background: #1f1f1f; 229 | 230 | --ion-card-background: #1e1e1e; 231 | } 232 | } --------------------------------------------------------------------------------