File

src/app/ui/selector/selector.component.ts

Implements

OnInit

Metadata

selector framadate-selector
styleUrls ./selector.component.scss
templateUrl ./selector.component.html

Index

Methods
Inputs

Constructor

constructor()

Inputs

selectorConfig
Type : SelectorConfig

Methods

ngOnInit
ngOnInit()
Returns : void
import {Component, Input, OnInit} from '@angular/core';

interface Item {
    label: string,
    value: string
}

interface SelectorConfig {
    label: string,
    name: string,
    id: string,
    selectorNgModel: any,
    listItems: Item[]
}

@Component({
    selector: 'framadate-selector',
    templateUrl: './selector.component.html',
    styleUrls: ['./selector.component.scss']
})
export class SelectorComponent implements OnInit {
    @Input() selectorConfig: SelectorConfig;

    constructor() {
    }

    ngOnInit() {
    }

}
<select
    class="custom-selector"
    name="{{selectorConfig.name}}"
    id="{{selectorConfig.id}}"
    [(ngModel)]="selectorConfig.selectorNgModel">
    <option value="{{item.value}}" selected *ngFor="let item of selectorConfig.listItems">
        {{item.label}}
    </option>
</select>

./selector.component.scss

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""