Last active
February 28, 2021 15:57
-
-
Save ssougnez/af1ca0464e9c32ac0c09ba736fac93fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { FormBuilder, FormGroup } from '@angular/forms'; | |
enum Fields { | |
Enabled = "enabled" | |
} | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'] | |
}) | |
export class AppComponent implements OnInit { | |
public form: FormGroup; | |
public Fields: typeof Fields = Fields; | |
constructor(private _fb: FormBuilder) { } | |
public ngOnInit() { | |
this.form = this._fb.group({ | |
[Fields.Enabled]: [true] | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment