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 was archived by the owner on Dec 4, 2017. It is now read-only.
OpaqueToken cannot be implemented in Dart, see angulardart/angular#35. I am opening this issue to hold a thread of discussion about alternatives for both the Dart and TS sides --- given that we want minimize difference across languages so as to provide a consistent UX. I'll focus the discussion on Dart, but the proposal holds for both.
For the purpose of this discussion, let's reuse the example given in the TS OpaqueToken section of the angular.io di chapter. Consider the following snippets of a Dart version of that example:
OpaqueToken cannot be implemented in Dart, see angulardart/angular#35. I am opening this issue to hold a thread of discussion about alternatives for both the Dart and TS sides --- given that we want minimize difference across languages so as to provide a consistent UX. I'll focus the discussion on Dart, but the proposal holds for both.
For the purpose of this discussion, let's reuse the example given in the TS OpaqueToken section of the angular.io di chapter. Consider the following snippets of a Dart version of that example:
Given that an
OpaqueToken
is no better than aString
in Dart, why not simply use an fresh type name introduced via an abstract class declaration:Given that TS also has abstract classes, this approach could be used consistently across languages.
Thoughts @vicb @mhevery @wardbell @thso @kwalrath ?
The text was updated successfully, but these errors were encountered: