我在Visual Studio中使用了打字机扩展来生成模型(Account.ts),但当我尝试在另一个类中导入模型时,它失败了。我做错了什么?
import { Account } from '../../models/greencard/Account';
错误
'C:/Users/me/Desktop/_REPOS/stuff/ClientApp/src/app/models/greencard/Account.ts' is not a module.
打字机文件
${
// 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];]
}]
}
自动生成的帐户.ts
module InvWebOps.EFModels.TypewriterTSTFiles {
// More info: http://frhagn.github.io/Typewriter/
export class Account {
// ID
public id: number = 0;
......