简体   繁体   中英

Default value in HTML form (handling roles by views or by default)

I am going to describe the need, I hope to make myself understood: I need to use several forms for users, according to the form filled in as a type of user, in my user model I use the id of another table for role management. in the html try to insert something like this:

value="9"

However it does not work, I'm using angular and the backend is developed in .Net Core.

If I understood your intention- Why do not you use Form-group , with form control? Where you can enter a default value, like this-

fb.group({
   yourControl: [0] // '0' is the default value
});

Hope this helps you, and that I understood what you mean.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM