Skip to content

Create module

florianInfo edited this page Feb 21, 2019 · 18 revisions

HOME > DOCUMENTATION > CREATE MODULE

Create a new type of Input (sound, text, etc.)

1. Create the new interface in the API

  1. Go in src/api/core/demo/input
  2. Create a folder called : type-input where type is the type of the input (ex: image-input, sound-input, ...)
  3. Create 2 typescript files inside : type-input.component.ts and type-input.presenter.ts
  4. Write this code in the type-input.component.ts file:
import {InputComponent} from '../input.component';
import { TypeInputPresenter } from './json-input.presenter';

export interface TypeInputComponent extends InputComponent{
	getPresenter():TypeInputPresenter;
        //some methods to implements
}

Replace Type by the name given before.

  1. Write this code in the type-input.presenter.ts file :
import {InputPresenter} from '../input.presenter';

export interface TypeInputPresenter extends InputPresenter{
  //some methods to implements
}

Replace Type by the name given before.

  1. In the folder src/api/core/demo/input create a file type-input.d.ts
  2. Write this code inside (export new interfaces created just before) :
export * from './type-input/type-input.presenter'
export * from './type-input/type-input.component'

Interfaces are created

2. Create a new angular component

  1. open cmd
  2. go in src/app/demo/input
  3. command to generate a new component : ng generate component component_name

Create a new type of Model

Clone this wiki locally