Skip to content

koegel/jsonforms-ionic-playground

 
 

Repository files navigation

Getting started

  1. Install ionic via npm install -g ionic@3.9.2 (or follow instructions at Installing Ionic)
  2. Clone this repo
  3. Install dependencies via npm install
  4. Execute ionic serve. Alternatively, if you want to execute the app within the emulator, follow the instructions from the Ionic Docs (Make sure to have your $JAVA_HOME, $ANDROID_HOME environment variables configured).

General usage

If you want to make use of the ionic-renderers in your own project, please follow these guidelines:

  1. Install dependencies
    • npm i @jsonforms/core
    • npm i @jsonforms/angular
    • npm i @jsonforms/ionic-renderers
  2. Import JsonFormsIonicModule and add it to the imports section
  3. Create a store configuration, e.g. in a file called store.ts and add the following contents
   import { combineReducers, Reducer } from 'redux';
   import {
     jsonformsReducer,
     JsonFormsState
   } from '@jsonforms/core';
   import {ionicRenderers} from "@jsonforms/ionic-renderers";
   
   export const rootReducer: Reducer<JsonFormsState> = combineReducers({ jsonforms: jsonformsReducer() });
   
   export const initialState: any = {
     jsonforms: {
       renderers: ionicRenderers,
       fields: [],
     }
   };
  1. Initialize the store via ngRedux (e.g. within ngOnInit of your app module)
     import {Actions} from '@jsonforms/core';
     import {initialState, rootReducer} from './store';
    
     ngRedux.configureStore(
       rootReducer,
       initialState
     );
     
     ngRedux.dispatch(
       Actions.init(
         data,
         schema
         uischema
       )
     );

Covered Features

Layouts

Controls

About

Playground for integrating JSONForms with Ionic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 62.7%
  • CSS 21.1%
  • HTML 11.3%
  • JavaScript 4.9%