發表文章

目前顯示的是 2月 11, 2019的文章

Los Andes, Chile

圖片
City and Commune in Valparaíso, Chile Los Andes City and Commune Coat of arms Los Andes Location in Chile Coordinates: 32°50′S 70°37′W  /  32.833°S 70.617°W  / -32.833; -70.617 Coordinates: 32°50′S 70°37′W  /  32.833°S 70.617°W  / -32.833; -70.617 Country   Chile Region   Valparaíso Province Los Andes Santa Rosa de Los Andes 31 July 1791 Government [1]  • Type Municipality  • Alcalde Manuel Rivera Martínez Area [2]  • Total 1,248.3 km 2 (482.0 sq mi) Elevation 819 m (2,687 ft) Population (2012 Census) [2]  • Total 63,009  • Density 50/km 2 (130/sq mi)  • Urban 55,388  • Rural 4,810 Sex [2]  • Men 30,247  • Women 29,951 Time zone UTC-4 (CLT [3] )  • Summer (DST) ...

Set variable from function

圖片
0 This may be an easy question/answer, but I can't seem to wrap my head around it: I am validating fields with a function using AbstractControl: errorVar: boolean = false function(c: AbstractControl): [key: string]: string | null // validation if 'test' is true or not goes here if(test) let errorMessageText: "test" return 'errorText': errorMessageText; return null; Besides the errorText I want the function to also set the variable errorVar to true and to false if the function returns null. angular typescript share | improve this question edited Nov 14 '18 at 10:48 PhilipK asked Nov 14 '18 at 9:14 PhilipK PhilipK 23 7 And what is your problem? – Daniel Hilgarth Nov 14 '18 at 9:15 If I try to set the variable inside the function it comes back as "undefined is not an object. So I'm fairly new to this and can't figure out why. So my idea was to ...