【发布时间】:2021-09-15 16:01:21
【问题描述】:
我使用 Typewriter 从我的 C# 代码中创建了一个打字稿类。当我尝试通过导入在我的 Angular 项目中引用它时,它说如果我使用命名空间,模块不存在或命名空间无法识别。
将类添加到我的项目以便我可以在其他文件中使用它的正确方法是什么?
module Budget.Infrastructure.Model {
// $Classes/Enums/Interfaces(filter)[template][separator]
// filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.
// template: The template to repeat for each matched item
// separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]
// More info: http://frhagn.github.io/Typewriter/
export class User {
// ID
public id: string = null;
// FIRSTNAME
public firstName: string = null;
// LASTNAME
public lastName: string = null;
// EMAIL
public email: string = null;
}
}
【问题讨论】:
-
你使用的是 Angular 还是 Angularjs?
-
也许这对你有帮助?提示:模块现在实际上是 TS 中的命名空间:stackoverflow.com/questions/55068604/…
标签: angular typescript typewriter