Responsive Ad Area

Share This Post

test

TS file generated by Typewriter is not a module

I used the Typewriter extension in Visual Studio to generate a model (Account.ts), but when I try to import the model in another class it fails. What am I doing wrong?

import { Account } from '../../models/greencard/Account';

Error

'C:/Users/me/Desktop/_REPOS/stuff/ClientApp/src/app/models/greencard/Account.ts' is not a module.   

Typewriter file

${
    // Enable extension methods by adding using Typewriter.Extensions.*
    using Typewriter.Extensions.Types;

    // Uncomment the constructor to change template settings.
    //Template(Settings settings)
    //{
    //    settings.IncludeProject("Project.Name");
    //    settings.OutputExtension = ".tsx";
    //}

    // Custom extension methods can be used in the template by adding a $ prefix e.g. $LoudName
    string LoudName(Property property)
    {
        return property.Name.ToUpperInvariant();
    }
}
module InvWebOps.EFModels.TypewriterTSTFiles {

templates e.g. $Properties[public $name: $Type][, ]

    // More info: http://frhagn.github.io/Typewriter/

$Classes(Account)[
    export class $Name {
        $Properties[
        // $LoudName
        public $name: $Type = $Type[$Default];]
    }]
}

Autogenerated Account.ts

module InvWebOps.EFModels.TypewriterTSTFiles {

    // More info: http://frhagn.github.io/Typewriter/


    export class Account {

        // ID
        public id: number = 0;
     ......


TS file generated by Typewriter is not a module
TS file generated by Typewriter is not a module
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar