進口微風=模塊(微風)是給我以下錯誤使用別名: 模塊不能由非模塊式別名打字稿和微風模塊不能由非模塊式
/// <reference path="../typings/breeze.d.ts" />
export module DataContext {
import breeze = module(Breeze);
export class FileStructure {
private EntityQuery: breeze.EntityQuery;
private Manager: breeze.EntityManager;
constructor(MainController: string) {
//validate the format api/BreezeController/
this.EntityQuery = new breeze.EntityQuery;
this.Manager = this.configureBreezeManager(MainController);
}
private configureBreezeManager(MainController: string) {
breeze.NamingConvention.camelCase.setAsDefault();
return new breeze.EntityManager(MainController);
}
public getAllFileStructures()
{
//define the query
var query =
this.EntityQuery
.from('FileStructure')
.using(this.Manager).execute()
.then(this.querySucceeeded)
.fail(this.queryFailed);
return query;
}
//define the promises and how they will behave once a query its executed.
private querySucceeeded(data) {
return data.results;
}
private queryFailed(error) {
//
}
}
}
import =不帶引號的模塊語句指的是「內部」模塊,而帶引號的模塊語句指的是「外部」模塊。 AMD模塊是「外部」模塊,因此需要報價。 –