@universis/forms
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

@universis/forms

Implementation of angular-formio for Universis client applications.

Usage

npm i @universis/forms

Import AdvancedFormsModule:

    @NgModule({
    declarations: [
        ...
    ],
    imports: [
        CommonModule,
        BrowserModule,
        BrowserAnimationsModule,
        HttpClientModule,
        TranslateModule.forRoot(),
        SharedModule.forRoot(),
        ...,
        AdvancedFormsModule.forRoot(),
        ...
    ],
    bootstrap: [AppComponent]
    })
    export class AppModule {
      constructor() {
          ...
      }
    }

and start using AdvancedFormComponent:

<advanced-form-edit formName="Courses/edit" [(data)]="model">
</advanced-form-edit>

or

<advanced-form-edit [(data)]="model" (customEvent)="onCustomEvent($event)" 
[formConfig]="formConfiguration" ></advanced-form-edit>

Development

Import @universis/forms as submodule in any angular cli project by replacing newProjectRoot as already configured in your angular.json

git submodule add https://gitlab.com/universis/forms.git <newProjectRoot>/forms

e.g.

git submodule add https://gitlab.com/universis/forms.git projects/forms

Add the following entries to tsconfig.app.json#compilerOptions.paths:

{
    "compilerOptions": {
        "paths": {
            "@universis/forms": [
                "<newProjectRoot>/forms/src/public_api"
            ]
            ...
        }
    }
}  

If you want to include @universis/forms as an angular cli project, include the following section in angular.json under projects:

"projects": {
  "forms": {
    "root": "<newProjectRoot>/forms",
    "sourceRoot": "<newProjectRoot>/forms/src",
    "projectType": "library",
    "prefix": "lib",
    "architect": {
      "build": {
        "builder": "@angular-devkit/build-ng-packagr:build",
        "options": {
          "tsConfig": "<newProjectRoot>/forms/tsconfig.lib.json",
          "project": "<newProjectRoot>/forms/ng-package.json"
        }
      },
      "test": {
        "builder": "@angular-devkit/build-angular:karma",
        "options": {
          "main": "<newProjectRoot>/forms/src/test.ts",
          "polyfills": "<newProjectRoot>/forms/src/polyfills.ts",
          "tsConfig": "<newProjectRoot>/forms/tsconfig.spec.json",
          "karmaConfig": "<newProjectRoot>/forms/karma.conf.js",
          "watch": false,
          "codeCoverage": true,
          "scripts": []
        }
      },
      "lint": {
        "builder": "@angular-devkit/build-angular:tslint",
        "options": {
          "tsConfig": [
            "<newProjectRoot>/forms/tsconfig.lib.json",
            "<newProjectRoot>/forms/tsconfig.spec.json"
          ],
          "exclude": [
            "**/node_modules/**"
          ]
        }
      }
    }
  },
  ...
}

Dependencies (1)

Dev Dependencies (2)

Package Sidebar

Install

npm i @universis/forms

Weekly Downloads

11

Version

1.1.10

License

LGPL-3.0-or-later

Unpacked Size

1.52 MB

Total Files

54

Last publish

Collaborators

  • universis