Starts in:
2 DAYS
3 HRS
34 MIN
24 SEC
Starts in:
2 D
3 H
34 M
24 S
Open Closed

Question about generate-proxy #2836


User avatar
0
jimcai created

Dear, I have some questions about generate-proxy under angular UI

  1. Is it possible map long datetype(.net) to string(.ts)/bigint(es2020) not number(.ts), as you known, there is precision issue in javascript. eg let x = 3458033015597309954 console.log(x) // 3458033015597310000

    export interface CreateUpdateGroupDto extends AuditedEntityDto < number > // wrong type mapping

  2. Is it possible to auto generate client validaton for angular UI like asp.net mvc? for example, a DTO class public class CreateUpdateEmployeeDto : AuditedEntityDto { [Required] [StringLength(32)] public string Name { get; set; } }

after run generate-proxy command, we got a class for angular export interface CreateUpdateGroupDto extends AuditedEntityDto < number > { // here number should expect bigint or string as explain in question 1 name: string; }

where I used in frombuilder like this.form = this._fb.group( { name: ["", [Validators.required, Validators.maxLength(32)]], // manually map from Dto object. } I hope it could generate a validation class like public interface CreateUpdateEmployeeDtoValidators { public name: ValidationErrors[]; } const validatorCreateUpdateEmployeeDto = { name: [ Validators.required, Validators.maxLength(32) ]}

and it is easy to use in formbuilder this.form = this._fb.group( { name: ["", validatorCreateUpdateEmployeeDto.name], }

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.1.4
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

1 Answer(s)
  • User Avatar
    0
    muhammedaltug created

    Hello,

    We will consider these requests. You can follow issues statuses in https://github.com/abpframework/abp/issues/12221 and https://github.com/abpframework/abp/issues/12222

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06