projects/common/lib/components/toggle/toggle.component.ts
selector | common-toggle |
styleUrls | ./toggle.component.scss |
templateUrl | ./toggle.component.html |
Properties |
|
Methods |
Inputs |
Outputs |
constructor()
|
data | |
Type : boolean
|
|
label | |
Type : string
|
|
dataChange | |
Type : EventEmitter<boolean>
|
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
Public objectId |
Type : string
|
Default value : UUID.UUID()
|
Inherited from
Base
|
Defined in
Base:11
|
An identifier for parents to keep track of components |
Lorem ipsum dolor sit amet consectetur adipisicing elit. Sapiente, magnam ipsam. Sit quasi natus architecto rerum unde non provident! Quia nisi facere amet iste mollitia voluptatem non molestias esse optio?
Aperiam fugiat consectetur temporibus, iste repellat, quisquam sapiente nisi distinctio optio, autem nemo tenetur error eum voluptatibus ab accusamus quis voluptatum blanditiis. Quam et ut reprehenderit vitae nobis, at ipsum!
Exercitationem pariatur animi repudiandae corporis obcaecati ratione ducimus beatae quam, nostrum magnam unde numquam quidem cupiditate odit id. Beatae alias molestiae, optio incidunt harum quia voluptates deserunt sequi. Nesciunt, optio.
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Base } from '../../models/base';
@Component({
selector: 'common-toggle',
templateUrl: './toggle.component.html',
styleUrls: ['./toggle.component.scss']
})
export class ToggleComponent extends Base implements OnInit {
@Input() data: boolean;
@Input() label: string;
@Output() dataChange: EventEmitter<boolean> = new EventEmitter<boolean>();
constructor() {
super();
}
ngOnInit() {
}
}
<common-radio [value]="data" [label]="label"
[radioLabels]='[{"label": "No", "value": false},{ "label": "Yes", "value": true}]'
(statusChange)="dataChange.emit($event)">
</common-radio>