【发布时间】:2012-12-02 11:50:01
【问题描述】:
我正在尝试开始使用 TypeScript 和 Backbone,我的所有类都在单独的文件中,使用 RequireJS。我有一个模型和一个集合:
EntityModel.ts:
/// <reference path="../modules/backbone.d.ts"/>
export class EntityModel extends Backbone.Model{
}
EntityCollection.ts
/// <reference path="../modules/backbone.d.ts"/>
import em = module("../models/EntityModel");
export class EntityCollection extends Backbone.Collection{
model = em.EntityModel;
}
我收到一条错误消息:
导出类的公共成员“模型”已经或正在使用私有类型“em”
我只是想告诉它我的收藏要使用什么类型的模型,但似乎在第一个障碍中落下!
【问题讨论】:
标签: backbone.js requirejs typescript