0.0.25 • Published 5 years ago

enumselectioncontrols v0.0.25

Weekly downloads
76
License
-
Repository
-
Last release
5 years ago

Enumselectioncontrols

Please note - this repository contains a library and a consuming project of an enum selection control for enums in Typescript to be used in Angular. It contains a SELECT control and a list of RADIO button INPUT control. It is however in beta still and should not be used in production yet. Known issues:

  • The group name of the radio button is problematic to set in the DOM and must be resolved.
  • The controls use Norwegian language some places.
  • It is not possible to assign custom descriptions to the enum members - You can choose from the RAW enum values and text only. E.g. like the Display Attribute in C# capapbilities.

Code example:

The following HTML shows how to use these two library components.

app.component.html

<form>
  <div class="form-group span-2">
    <label>Iskrem:</label>
    <lib-enum-select
      (selectionChange)="onIceCream($event)"
      [enumtype]="IceCreamType"
    ></lib-enum-select>
  </div>

  <div class="form-group span-2">
    <label>Iskrem:</label>
    <lib-enum-radio-button-list
      [enumtype]="IceCreamType"
      (selectionChange)="onIceCream($event)"
      [groupname]="IceCreamGroup"
    ></lib-enum-radio-button-list>
  </div>
</form>

With a sample app.component.ts file 'view model':

app.component.ts

typescript import { Component } from "@angular/core"; import { IceCream } from "./ice-cream";

@Component({ selector: "app-root", templateUrl: "./app.component.html", styleUrls: "./app.component.css" }) export class AppComponent { title = "Consume EnumSelectors"; IceCreamType = IceCream; IceCream: IceCream = IceCream.None;

onIceCream(someIcream) { this.IceCream = someIcream; } }

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.0.

## Code scaffolding

Run `ng generate component component-name --project enumselectioncontrols` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project enumselectioncontrols`.
> Note: Don't forget to add `--project enumselectioncontrols` or else it will be added to the default project in your `angular.json` file.

## Build

Run `ng build enumselectioncontrols` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build enumselectioncontrols`, go to the dist folder `cd dist/enumselectioncontrols` and run `npm publish`.

## Running unit tests

Run `ng test enumselectioncontrols` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago