Skip to content

nullrefio/FullStackDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample REST and Angular projects with advanced programming concepts

Using C# to control Angular validation and controls

Compile-time Checked Typescript

Synchronize Angular and C#

Functional C# with examples

C# static analysis using unit tests

This demo project uses C# validation attributes and custon Swagger generation to define compile-tim checked Typescript. The Angular controls and HTML are defined from object metadata constants emitted from the Swagger document including nullable, default, allow sort, data type, readonly, maxlength, minlength, required, identifier, display name, and description (tooltip).

This allows you to have Tyepscript code that will break and not compile if your C# objects are modified. Also, all validation is passed down from the C# definitions into Typescript. The form validators including required and max lengths are auto-generated from calls in TS files. HTML prompts, tooltips, and bindings are defined with generated constants that expose a problem immediately if the C# backing objects change.



Standard Angular Forms Binding

image



Angular Binding with generated metadata

image



Standard Angular HTML

image



Angular HTML with generated metadata

image