angular-docs-cn/packages/compiler
Chuck Jazdzewski 0e64261f26 feat(compiler-cli): lower metadata `useValue` and `data` literal fields (#18905)
With this commit the compiler will "lower" expressions into exported
variables for values the compiler does not need to know statically
in order to be able to generate a factory. For example:

```
  providers: [{provider: 'token', useValue: calculated()}]
```

produced an error as the expression `calculated()` is not supported
by the compiler because `calculated` is not a
[known function](https://angular.io/guide/metadata#annotationsdecorators)

With this commit this is rewritten, during emit of the .js file, into
something like:

```
export var ɵ0 = calculated();

  ...

  provdiers: [{provider: 'token', useValue: ɵ0}]
```

The compiler then will now generate a reference to the exported `ɵ0`
instead of failing to evaluate `calculated()`.

PR Close #18905
2017-08-31 09:46:16 -07:00
..
src feat(compiler-cli): lower metadata `useValue` and `data` literal fields (#18905) 2017-08-31 09:46:16 -07:00
test feat(compiler-cli): lower metadata `useValue` and `data` literal fields (#18905) 2017-08-31 09:46:16 -07:00
testing refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
BUILD.bazel refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
package.json refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00
rollup.config.js build: import tslib rather than output TS helpers (#16901) 2017-05-23 14:01:39 -06:00
tsconfig-build.json refactor(compiler): split compiler and core (#18683) 2017-08-16 17:58:53 -05:00