# custom-camera2

> Core module with ngrx shared business logic to be used in an Angular2 web app and a Ionic2 mobile app.

Latest version **0.0.19** (published 2018-05-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install custom-camera2
pnpm add custom-camera2
yarn add custom-camera2
bun add custom-camera2
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.19 |
| Published | 2018-05-07 |
| First published | 2018-05-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 63 |
| Unpacked size | 69.3 KB |
| Known vulnerabilities | 0 (+43 in 7 direct dependencies) |
| Install scripts | no |
| GitHub stars | 37 |
| Author | Jhonata Ribeiro |
| Maintainers | jhonataribeiro |
| Keywords | angular, angular2, ionic, ionic2, ngrx |

## Links

- npm: https://www.npmjs.com/package/custom-camera2
- Repository: https://github.com/benorama/ngrx-demo-apps
- Homepage: https://github.com/benorama/ngrx-demo-apps#readme
- Issues: https://github.com/benorama/ngrx-demo-apps/issues
- npm.io page: https://npm.io/package/custom-camera2

## Dependencies (63)

- [npm](https://npm.io/package/npm.md) ^5.7.1
- [rxjs](https://npm.io/package/rxjs.md) 5.5.2
- [xlsx](https://npm.io/package/xlsx.md) ^0.11.3
- [jspdf](https://npm.io/package/jspdf.md) ^1.3.5
- [rrule](https://npm.io/package/rrule.md) ^2.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [moment](https://npm.io/package/moment.md) ^2.18.1
- [install](https://npm.io/package/install.md) ^0.10.4
- [stompjs](https://npm.io/package/stompjs.md) ^2.3.3
- [zone.js](https://npm.io/package/zone.js.md) 0.8.18
- [ionicons](https://npm.io/package/ionicons.md) 3.0.0
- [ngx-chips](https://npm.io/package/ngx-chips.md) ^1.8.2
- [file-saver](https://npm.io/package/file-saver.md) ^1.3.3
- [ng2-charts](https://npm.io/package/ng2-charts.md) ^1.6.0
- [sw-toolbox](https://npm.io/package/sw-toolbox.md) 3.6.0
- [html2canvas](https://npm.io/package/html2canvas.md) ^1.0.0-alpha.9
- [@types/jspdf](https://npm.io/package/@types/jspdf.md) ^1.1.31
- [font-awesome](https://npm.io/package/font-awesome.md) ^4.7.0
- [@angular/core](https://npm.io/package/@angular/core.md) 5.0.3
- [@angular/http](https://npm.io/package/@angular/http.md) 5.0.3
- [ionic-angular](https://npm.io/package/ionic-angular.md) 3.9.2
- [sockjs-client](https://npm.io/package/sockjs-client.md) ^1.1.4
- [@angular/forms](https://npm.io/package/@angular/forms.md) 5.0.3
- [@ionic/storage](https://npm.io/package/@ionic/storage.md) 2.1.3
- [@angular/common](https://npm.io/package/@angular/common.md) 5.0.3
- [angular2-cookie](https://npm.io/package/angular2-cookie.md) ^1.2.6
- [cordova-android](https://npm.io/package/cordova-android.md) 7.0.0
- [cordova-browser](https://npm.io/package/cordova-browser.md) ^4.1.0
- [ionic2-autosize](https://npm.io/package/ionic2-autosize.md) ^1.1.1
- [angular-calendar](https://npm.io/package/angular-calendar.md) ^0.23.6
- [@angular/compiler](https://npm.io/package/@angular/compiler.md) 5.0.3
- [ng2-stomp-service](https://npm.io/package/ng2-stomp-service.md) ^1.2.2
- [@ionic-native/core](https://npm.io/package/@ionic-native/core.md) 4.4.0
- [@ionic-native/file](https://npm.io/package/@ionic-native/file.md) ^4.2.1
- [com.lampa.startapp](https://npm.io/package/com.lampa.startapp.md) ^0.1.4
- [@angular/animations](https://npm.io/package/@angular/animations.md) ^5.2.8
- [@ngx-translate/core](https://npm.io/package/@ngx-translate/core.md) ^9.1.1
- [@angular/flex-layout](https://npm.io/package/@angular/flex-layout.md) ^5.0.0-beta.13
- [@ionic-native/camera](https://npm.io/package/@ionic-native/camera.md) ^3.14.0
- [@ionic-native/market](https://npm.io/package/@ionic-native/market.md) ^4.5.3
- [@angular/compiler-cli](https://npm.io/package/@angular/compiler-cli.md) 5.0.3
- [@ionic-native/network](https://npm.io/package/@ionic-native/network.md) ^4.5.3
- [@ionic-native/printer](https://npm.io/package/@ionic-native/printer.md) ^4.5.3
- [cordova-plugin-device](https://npm.io/package/cordova-plugin-device.md) ^2.0.1
- [cordova-plugin-market](https://npm.io/package/cordova-plugin-market.md) ^1.2.0
- [ngrx-demo-core-teste1](https://npm.io/package/ngrx-demo-core-teste1.md) 0.0.1
- [@ionic-native/status-bar](https://npm.io/package/@ionic-native/status-bar.md) 4.4.0
- [cordova-plugin-whitelist](https://npm.io/package/cordova-plugin-whitelist.md) ^1.3.3
- [@angular/platform-browser](https://npm.io/package/@angular/platform-browser.md) 5.0.3
- [@ionic-native/file-opener](https://npm.io/package/@ionic-native/file-opener.md) ^4.1.0
- [@ionic-native/geolocation](https://npm.io/package/@ionic-native/geolocation.md) ^4.7.0
- [@ng-bootstrap/ng-bootstrap](https://npm.io/package/@ng-bootstrap/ng-bootstrap.md) ^1.0.0-beta.5
- [@ngx-translate/http-loader](https://npm.io/package/@ngx-translate/http-loader.md) 0.0.3
- [cordova-plugin-geolocation](https://npm.io/package/cordova-plugin-geolocation.md) ^4.0.1
- [@ionic-native/splash-screen](https://npm.io/package/@ionic-native/splash-screen.md) 4.4.0
- [cordova-plugin-splashscreen](https://npm.io/package/cordova-plugin-splashscreen.md) ^5.0.2
- [cordova-plugin-ionic-webview](https://npm.io/package/cordova-plugin-ionic-webview.md) ^1.1.16
- [cordova-plugin-ionic-keyboard](https://npm.io/package/cordova-plugin-ionic-keyboard.md) ^2.0.5
- [@ionic-native/app-availability](https://npm.io/package/@ionic-native/app-availability.md) ^4.5.3
- [cordova-plugin-appavailability](https://npm.io/package/cordova-plugin-appavailability.md) ^0.4.2
- [@ionic-native/speech-recognition](https://npm.io/package/@ionic-native/speech-recognition.md) ^3.6.1
- [cordova-plugin-speechrecognition](https://npm.io/package/cordova-plugin-speechrecognition.md) ^1.2.0
- [@angular/platform-browser-dynamic](https://npm.io/package/@angular/platform-browser-dynamic.md) 5.0.3

## Recent versions

- 0.0.19 (latest) — 2018-05-07
- 0.0.18 — 2018-05-07
- 0.0.17 — 2018-05-07
- 0.0.16 — 2018-05-07
- 0.0.15 — 2018-05-07
- 0.0.14 — 2018-05-07
- 0.0.13 — 2018-05-07
- 0.0.12 — 2018-05-07
- 0.0.11 — 2018-05-07
- 0.0.10 — 2018-05-07
- 0.0.9 — 2018-05-07
- 0.0.7 — 2018-05-07
- 0.0.6 — 2018-05-07
- 0.0.5 — 2018-05-03
- 0.0.4 — 2018-05-03
- … 3 more at https://npm.io/package/custom-camera2/versions

## README

## Introduction

This is a proof of concept that demonstrates the ability to share a Typescript package with core functionalities and business logic between an Angular web app and an Ionic mobile app.

Please check the Medium article [Hybrid mobile apps: sharing logic between Angular and Ionic apps](https://medium.com/@benorama/hybrid-mobile-apps-sharing-logic-between-angular2-and-ionic2-apps-7c32145b90d5#.m1x3vpyc0) for more info.

![Demo](https://cloud.githubusercontent.com/assets/394356/24591063/344c55ee-17f9-11e7-82ca-96821ac723b7.png)

**Goals:**

* encapsulate all the business logic in a core module, based on [@ngrx/store](https://github.com/ngrx/store),
* keep specific view layout, markup and navigation logic in the app projects.

Note: [@ngrx/store](https://github.com/ngrx/store) is a RxJS powered state management inspired by Redux for Angular apps. 
It's currently the most popular way to structure complex business logic in Angular apps.


## Running the apps locally

```
# Clone the repo
git clone https://github.com/benorama/ngrx-demo-apps.git
```

Prerequisites:
* [Typescript 2.0+](https://www.typescriptlang.org/index.html#download-links)
* [Angular CLI](https://cli.angular.io)
* [Ionic CLI](http://ionicframework.com/docs/cli/)

Note: `ngrx-demo-core` module is shared between the apps with `npm link` but it could be published to `npmjs` and be used as a regular dependency.

### ngrx-demo-core module

First, compile `ngrx-demo-core` shared module. 

It is based on official Ionic module template, which supports Angular's ngc and Ahead-of-Time compiling out of the box.
https://github.com/driftyco/ionic-module-template

```
# Go into core module directory
cd ngrx-demo-apps/core

# Install dependencies
yarn
# Or npm install

# Compile typescript into dist
yarn build
# Or npm run build

yarn link
# Or npm pack
# Or npm publish

# Note: during dev, you can use 'tsc -w'
```

The shared module is now installed locally and can be used in other local npm projects.

### ngrx-demo-web app

Install or link `ngrx-demo-core` shared module and run the web app.

```
# Go into web Angular2 app directory
cd ../web

# Install dependencies
yarn
# Or npm install

# Create a symlink from the local node_modules folder to the global shared module symlink
yarn link "ngrx-demo-core"
# Or npm install ../core/ngrx-demo-core-0.0.1.tgz (if you used npm pack)

# Run the web app locally
ng serve
```

### ngrx-demo-mobile app

As we did for the web app, install or link the `ngrx-demo-core` shared module and run the mobile app.

```
# Go into mobile Ionic2 app directory
cd ../mobile

# Install dependencies and typings (you can get a burger...)
yarn
# Or npm install

# Create a symlink from the local node_modules folder to the global shared module symlink
yarn link "ngrx-demo-core"
# Or npm install ../core/ngrx-demo-core-0.0.1.tgz (if you used npm pack)

# Run the mobile app locally
ionic serve
```

Note: for more info on using external lib on Ionic2
* [Third Party libraries in Ionic Apps](http://ionicframework.com/docs/v2/resources/third-party-libs/)
* [App Scripts](http://ionicframework.com/docs/v2/resources/app-scripts/)

## Bugs and feedback

If you have any questions or suggestions to improve the demo app, don't hesitate to submit an issue or a pull request!

---
_Source: https://npm.io/package/custom-camera2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
