dart-archive / ts2dart

ts2dart TypeScript to Dart transpiler
Apache License 2.0
181 stars 62 forks source link

Generate const Providers #366

Closed mhevery closed 8 years ago

mhevery commented 8 years ago

Now:

export const FOO: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
  new Provider(ServiceMessageBrokerFactory, {useClass: ServiceMessageBrokerFactory_}),
]);

Want:

export const FOO: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
  /* @ts2dart_provide */ {provide: ServiceMessageBrokerFactory, useClass: ServiceMessageBrokerFactory_},
]);

dart:

const FOO = const [
  const Provider(useClass: ServiceMessageBrokerFactory_),
];
mprobst commented 8 years ago

Discussed offline, this is not needed.