- Notifications
You must be signed in to change notification settings - Fork57
typeorm/ionic-example
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
You can use TypeORM in connection with thecordova-sqlite-storage plugin in your Ionic app.This project demonstrates how that would work.
To run this example in production or development mode you have to make sure,ionic andcordova are installed globally on your machine. After that you can install all necessary dependencies for running this example.
- Check if
npmis installed. Otherwise pleaseinstallnode.jsandnpm.
npm -v
- Install ionic and cordova command line interface globally.
npm install -g cordova ionic
- Install all dependencies listed in
package.json.
npm install
ionic serve
- Add an iOS or Android to the project.
ionic cordova platform add ios# orionic cordova platform add android- Run the app on your device.
ionic cordova run ios# orionic cordova run androidFor further information please readionic's deployment guide.
- Install the plugin
ionic cordova plugin add cordova-sqlite-storage --save
- Install TypeORM
npm install typeorm --save
- Install node.js-Types
npm install @types/node --save-dev
Add
"typeRoots": ["node_modules/@types"]to yourtsconfig.jsonundercompilerOptionsCreate a custom webpack config file like the oneincluded in this project to use the correct TypeORM version and add the config file to your
package.json(Required with TypeORM >= 0.1.7)
Since Ionic make a lot of optimizations while building for production, the following limitations will occur:
Entities have to be marked with the table name (eg
@Entity('table_name'))getRepository()has to be called with the name of the entity instead of the class (eggetRepository('post') as Repository<Post>)Date fields arenot supported:
@Column()birthdate:Date;
About
Example project to demonstrate TypeORM in an Ionic app
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.
