The problem with the Angular form caused by the NULL field in the database-I had to circle the earth to get into the fork in front of me.

  • NULL data in the database
  • Angular

    DB

  • Angular

    console.log():

    NULL

  • Angular

    :this.expandForm.setValue({...val[0]});:

    valoordercode



  • after processing by the above method, you can assign the value that exists on the DB side to
    when all the attributes are present. If there is a value on the DB side, fill it, and then the NULL value on the DB side is also NULL
    . Then you can happily assign the value: {... newData} later.
    I feel so tired. Is there any other way to achieve it? Or did I go the wrong way in the first place?
    Welcome to contact QQ:409223171, please indicate: null


Database fields are better off without null, and each field is given a default value. For example, the field definition of mysql table

  `currency_desc` varchar(100) NOT NULL DEFAULT '' COMMENT 'xxxx',
  `days` int(11) NOT NULL DEFAULT '0' COMMENT 'xxxxxx',
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e520db-4519d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e520db-4519d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?