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)
- @angular/common documentation is missing in Workspace npm dependencies' Default Dependencies section HOT 1
- There's no explanation in the Angular Docs on how to register a different locale. HOT 1
- Set Signal within Image onload event fails with NG0600 error HOT 3
- Content projection with nested IF does not work HOT 1
- Fallback content throws with multiple components v18.x
- Add support for using functions as pipes HOT 6
- Bug in @placeholder block causing delay in server-side rendering
- can't get the images to show HOT 1
- The update.angular.io does not show how to update angular material although the checkbox is checked HOT 1
- Angular's web components not working inside AngularJS structural directives HOT 2
- Missing built-in Pipes API page HOT 1
- Differences in change detection between components using @for vs *ngFor HOT 1
- NgZoneSchedulingMode not exported HOT 1
- Page Not Found HOT 1
- Functions are missing from localForage after updating Angular to latest version HOT 2
- "updateOn: 'blur'" does not work in formBuilder/formControl HOT 11
- App-shell docs are out-of-date
- https://angular.dev/guide/security not found HOT 2
- Destroy component itself HOT 5
- Image lazy loading doesn't work in SSR when using ngTemplateOutlet and disabled hydration
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.