Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,390 --> 00:00:07,050
There's one last optimization will want to make in the form the country dropdown will not have a default
2
00:00:07,050 --> 00:00:07,640
value.
3
00:00:08,310 --> 00:00:14,400
It appears as if it's empty, will want to force a default value, which is normal for dropdown fields.
4
00:00:14,610 --> 00:00:16,010
Let's learn how to do that.
5
00:00:16,650 --> 00:00:19,320
Let's go back to the editor and the component.
6
00:00:19,350 --> 00:00:22,050
We're going to scroll down to the data function.
7
00:00:24,630 --> 00:00:27,660
Will define a new property called user data.
8
00:00:27,870 --> 00:00:29,730
Its value will be an object.
9
00:00:32,299 --> 00:00:39,680
Inside this object will add initial values for the fields, the property name in the object must correspond
10
00:00:39,680 --> 00:00:42,500
to the name assigned to the field in the template.
11
00:00:43,010 --> 00:00:45,750
We're going to have the country field to this object.
12
00:00:46,160 --> 00:00:50,530
The value for this must be the initial value we want to give to the field.
13
00:00:50,900 --> 00:00:52,400
We'll send it to USA.
14
00:00:55,020 --> 00:01:01,380
The next step is to tell validate that we want to use these initial values in our form, we're not setting
15
00:01:01,380 --> 00:01:03,300
initial values for every input.
16
00:01:03,600 --> 00:01:07,050
We only need to out the ones we want to have initial values.
17
00:01:07,170 --> 00:01:09,090
Scroll up to the form component.
18
00:01:11,810 --> 00:01:19,160
We can add a property called initial values on the component will bind this to the user data data property.
19
00:01:21,760 --> 00:01:27,930
The form component will use this object to apply initial values to the respective fields in these slot
20
00:01:27,940 --> 00:01:32,620
content, let's refresh the page on the browser to view the registration form.
21
00:01:35,240 --> 00:01:41,960
The country dropdown is selecting the USA option by default, by using the initial values prop on the
22
00:01:41,960 --> 00:01:45,780
form, we can configure the form to have some default values.
23
00:01:46,130 --> 00:01:48,490
We're finished with adding some default values.
24
00:01:48,710 --> 00:01:51,600
We won't have default values for the other inputs.
25
00:01:51,740 --> 00:01:53,270
It's fine to leave them empty.
2475
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.