import { Component, OnInit } from '@angular/core'; import { FormGroup, FormControl } from '@angular/forms'; @Component({ selector: 'app-section', templateUrl: './text-demo.component.html', styleUrls: ['./text-demo.component.scss'] }) export class TextDemoComponent implements OnInit { formGroup = new FormGroup({ name: new FormControl("Sam"), age: new FormControl(12), gender: new FormControl("male"), married: new FormControl("yes"), address: new FormControl("山东青州市"), dates: new FormControl('2019-08-20T00:00:00'), sizes: new FormControl(true), numbers: new FormControl(123456789), numbers2: new FormControl(0.23451111), numbers3: new FormControl(0.56789), numbers4: new FormControl(123456789.98765), numbers5: new FormControl(555), numbers6: new FormControl(0.555), }) currentLanguage = 'zh-CHS' name = { 'en': 'ameng' } age = { 'zh-CHS': '1900', 'en': null } married = { 'zh-CHS': '已婚', 'en': 'married' } birthday = { 'zh-CHS': '2019-08-28 10:00:00', 'en': '2019-08-28 10:00:00' } hasChildren = { 'zh-CHS': '1', 'en': '0' } constructor() { } ngOnInit() { } }