Prerequisites
- What is your product version? V10.1.0
- What is your product type (Angular or MVC)? Angular
- What is product framework type (.net framework or .net core)? net50
Hi There,
I have some AppConsts set in the API project for various fieldlengths - are these exposed anywhere in the angular project to save duplication when validating input?
Kind Regards, AJ.
4 Answer(s)
-
0
Hi @ashjackson,
No, consts on the server side are not shared with clients. You can use AppConsts.ts in Angular or you can return consts using an AppService but we prefer defining them in Angular app.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi There, A further question to this point, how do the values from appconfig.json get assigned to their partners in AppConsts.ts? If I wanted to add my a new value to AppConsts which is defined in appcondig.json, can I simple add to both files, or is there another class which reads in and assigned the values?
Kind Regards, AJ.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
Another option would be returing the values you want from SessionAppService's GetCurrentLoginInformations method. This will be transferred to Angular app and can be assigned to values on session object here. Then, you can access these values on your Angular app.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thankyou, this will be very useful.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)