我几乎完全复制了 Inversify 文档(版本 1.2.2),但它无法编译,给我 Typescript 错误 TS1238。为什么?
'use strict';
import './tools/typescriptImports';
import IServer = require('./iServer.ts');
import IDatabase = require('../database/iDatabase');
import express = require('express');
import bodyParser = require('body-parser');
import config = require('../config');
import types = require('../tools/types.ts');
import _ = require('lodash');
import async_ = require('async');
import { Inject } from "inversify";
@Inject("IDatabase") // <- error TS1238: Unable to resolve signature of class decorator when called as an expression. Supplied parameters do not match any signature of call target.
class Server implements IServer
{
db : IDatabase;
expressApp : express.Express;
constructor(db : IDatabase)
{
this.db = db;
...
}
}