frhagn / Typewriter

Automatic TypeScript template generation from C# source files
http://frhagn.github.io/Typewriter
Apache License 2.0
537 stars 132 forks source link

'Default' is not defined in 'Type' #90

Closed boedlen closed 8 years ago

boedlen commented 8 years ago

I just installed Typewriter via http://frhagn.github.io/Typewriter/index.html and wanted to try out the KnockoutJS example, but i get the error below when i paste in the knockout example from http://frhagn.github.io/Typewriter/pages/examples.html.

'Type' does not contain a definition for 'Default' and no extension method 'Default' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)

Is there some other way i can get the default value for a type?

boedlen commented 8 years ago

Just found this line in the changelog:

Moved $Default from type to extensions. (Note: To use $Default, add "using Typewriter.Extensions.Types;" to your template.)

And it fixed my issue.

Maybe using Typewriter.Extensions.Types; should be added to the top of the Knockout example.

frhagn commented 8 years ago

Hi @boedlen, I've updated the Knockout example. Thanks for pointing it out..