You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
@Component(
[...]
template:'''<div *ngFor="let element of elementsToShow">{{element}}</div>'''
directives: [CORE_DIRECTIVES],
)
classMyComponent {
staticfinalList<String> elementsToShow = ["one", "two", "three"];
}
Currently throws an error:
EXCEPTION: NoSuchMethodError: method not found: 'get$elementsToShow' (_ctx.get$elementsToShow is not a function)
Expected behavior
The static member elementsToShow is accessible just like a non-static class member.
Minimal reproduction of the problem with instructions
See current behavior.
What is the motivation / use case for changing the behavior?
Static members are intended for members that are the same for every instance of the class. Using Angular should not force the user to move those to a non-static member, or force the creation of a non-static getter to forward this variable.
* Added `exports: [ ... ]` to `@Component`, which allows the limited use of
top-level fields and static methods/fields in a template without making an
alias getter in your class. Implements
[#374](https://github.com/dart-lang/angular/issues/374).
```dartimport 'dart:math' show max;@Component( selector: 'comp', exports: const [ max, ], // Should write '20' template: '{{max(20, 10)}}',)class Comp {}
Forwarded from angular/angular: angular/angular#22345
Seems to collide with: #374
I'm submitting a...
Current behavior
Currently throws an error:
Expected behavior
The static member
elementsToShow
is accessible just like a non-static class member.Minimal reproduction of the problem with instructions
See current behavior.
What is the motivation / use case for changing the behavior?
Static members are intended for members that are the same for every instance of the class. Using Angular should not force the user to move those to a non-static member, or force the creation of a non-static getter to forward this variable.
Environment
Angular version: 4.0.0+2 (Dart)
Browser:
For Tooling issues:
The text was updated successfully, but these errors were encountered: