fix(compiler): don’t lower property accesses of exported symbols (#19301)

E.g. this allows the following to work:
```
@Decorator({
  useValue: MyClass.someMethod
})
class MyClass {
  static someMethod() {}
}
```
PR Close #19301
This commit is contained in:
Tobias Bosch
2017-09-20 16:26:11 -07:00
committed by Igor Minar
parent 62602b9bd8
commit 45747ed531
2 changed files with 26 additions and 2 deletions

View File

@ -54,6 +54,20 @@ describe('Expression lowering', () => {
.toBeTruthy('did not find the useValue');
});
it('should not request a lowering for useValue with a reference to a static property', () => {
const collected = collect(`
import {Component} from '@angular/core';
@Component({
provider: [{provide: 'someToken', useValue:◊value: MyClass.someMethod◊}]
})
export class MyClass {
static someMethod() {}
}
`);
expect(collected.requests.size).toBe(0);
});
it('should request a lowering for useFactory', () => {
const collected = collect(`
import {Component} from '@angular/core';