1

I've seen issue #415 solved for generating typescript files for ABP.

A couple of mount ago I started a project based on the ABP template, Angular1 and EF but till now I have not found the way to add this feature to my VS project.

I have given a look to TypeScriptServiceGenerator.cs in the source codes, but I really don't know how to invoke it during my development process.

Does anybody has an example?

Thank you very much in advance!

Gianpiero
  • 3,349
  • 1
  • 29
  • 42

1 Answers1

0

I created t4 template(TypeScriptTemplate.tt) for generation .d.ts(TypeScriptTemplate.d.ts) annotation file for all rest API proxies(at case of AngularJS). Included it into Web project, so you can simple rebuild it and then ran corresponding .tt file, as a result .d.ts file will be created with bunch of interfaces and you can use them as intellisence and for validation purposes on client side during development. You can view more info with example at rejected pull request. Code, that actually do all work, is located at TypeScriptGenerator.cs:

Excerpt from autogenerated output .d.ts file:

interface UserAppService {
    prohibitPermission(input: ProhibitPermissionInput, ajaxParams?: JQueryAjaxSettings): AbpResultVoid;
    removeFromRole(userId: number, roleName: string, ajaxParams?: JQueryAjaxSettings): AbpResultVoid;
    getUsers(ajaxParams?: JQueryAjaxSettings): AbpResult<ListResultDto<UserListDto>>;
    createUser(input: CreateUserInput, ajaxParams?: JQueryAjaxSettings): AbpResultVoid;
 }

enter image description here

Slava Utesinov
  • 13,410
  • 2
  • 19
  • 26