di.js
di.js copied to clipboard
Confused about the way injected values are resolved when they share common type
class Database{
}
class MySql extends Database {}
class PostgreSql extends Database {}
@Inject(Database,Database)
class DatabaseSyncService {
constructor(sourceDatabase: Database, destinationDatabase: Database){}
}
function main(){
var injector = new Injector([PostgreSql,MySql]);
var syncService = injector.get(DatabaseSyncService);
}
What will be provided to the syncService instance?