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)
- Add ability to update secondary signal when input signal changes HOT 2
- Report Error when checking if two unboxed signals are > or < each other? HOT 1
- Add Documentation how to programmatically set Input Signals HOT 2
- Add global configuration for the default change detection and styles encapsulation settings
- Showcasing a counter as a signal example in playground HOT 2
- routerLinkActiveOptions fragment add option to not match when no fragment is used
- Try out Inject page not found
- docs(rxjs-interop): toSignal injection context HOT 1
- [Security Vulnaraibility] Any Patch for `webpack-dev-middleware` about Path Traversal ? HOT 1
- After upgrading to v17 unable to see imported components HOT 1
- Publishing an SSR app w/ Angular 17 on a cPanel is possible, right? HOT 2
- Number inputs with a dynamic type always return strings HOT 1
- Feature Request: Introduce Concise Syntax for Defining Template Variables in Angular Templates HOT 4
- i can see the web of animation api's of angular. HOT 1
- Wrong url in app creation HOT 1
- NG0952: Input is required but no value is available yet. HOT 3
- Angular 17 with PWA fail always updating with "TOO MANY REDIRECTS"
- output-hashing in angular 17 (prerender mode) does not work
- Angular Universal does not generate the HTML whose data is fetched from an API. HOT 1
- slow server response time in dynamic routes when using Angular SSR HOT 3
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.