Comments (8)
@vicb Please let us know when you can start working on it.
from angular.
new syntax that we agreed on...
class Foo {
@FINAL('bar,name,age')
@CONST
constructor(age: number, name: string) {
this.bar:boolean = true;
this.name:string = 'Hello ' + name;
this.age = age;
}
}
get transpiled into....
class Foo {
final int age;
final String name;
final bool bar;
const Foo(int age, String name) : bar = true, age = age, name = 'Hello ' + name {
// Note how final fields have been hoisted into the "initializer", after the colon.
}
}
from angular.
What would be the purpose of the @FINAL
here ? All fields have to be final
with a constant constructor.
@FINAL
could be useful for non-const ctor to force members to be final
. What about @FINAL(['bar', 'name', 'age'])
? In a second step the final
modifier could probably be added automatically by visiting the class. If we agree on this we should probably evaluate the effort of writing the "final
transfomer" and if it is not too complex then skip the intermediate @FINAL
. What do you think ?
side notes:
- age should probably be a
num
, see #17 - I think that a const ctor could not have a body in Dart then the transpiled code from the previous post is not valid, there should be a "
;
" after the initializer list
from angular.
@mhevery I want to fix #24 before and then I'll start working on this issue. Probably later today or tomorrow.
from angular.
+1 for Making all fields final
by default if the constructor is const
As for your sidenotes: yes, yes.
from angular.
@vicb [https://github.com//issues/11#issuecomment-57293151] sounds good to me, also agree with @vojtajina and making @FINAL
optional.
from angular.
🔫
from angular.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
from angular.
Related Issues (20)
- Disable dev tools by code? HOT 1
- Make font of the documentation bigger HOT 1
- Future of fake timer testing in a zoneless world
- Angular.dev Playground is broken HOT 1
- Angular SSR don't render HOT 6
- Angular.dev doesn't cover Resolvers or how to fetch dynamic data
- Angular.dev show v0 instead of the latest version v17 HOT 4
- NullInjectorError in combination with standAlone is very unclear? HOT 3
- Router Outlet won't work if router link is in ngTemplate HOT 2
- NullInjectorError: No provider for Firestore2! HOT 1
- angular.dev: youtube embeds are being blocked on firefox
- reading required signal input from effect causes error NG0950 when done inside structural directive creating an embedded view after promise resolves HOT 5
- withComponentInputBinding doesn't work as excepted with input signals HOT 1
- Angular 17 @for has memory leak HOT 1
- Reactive forms directives should be standalone HOT 1
- Rename Change detection "Default"
- `swPush.requestSubscription` never resolves on Arc browser (mac os) HOT 1
- AngularGPT
- Recursive template with @defer HOT 3
- The output-function page is not accessible https://angular.dev/guide/output-function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.