Comments (14)
wrt TypeScript:
- fields can be initialized where they're defined
- fields are not initialized iff an initializer is present (not implicitly set to
null
)
from angular.
We should add support for these in Traceur. TS supports these and the goal was to use TS type syntax inside Traceur.
from angular.
During the discussion with @arv, we rise an "issue" with initializers: while those are supported in Dart, the intialization would need to happen at ctor time in JS.
Let's say you have this code:
class Parent {
name:string='Joe';
}
class Child extends Parent {
age:int;
constructor(age:int) {
this.age = age;
//super(); - this would be needed to have this code work properly
}
}
Parent.name
would not be initialized when you instantiate a Child
class because super()
is not called. However it seems weird to call super()
when no ctor is defined on Parent
- it would only be generated at compile time to initialize the fields.
May be the best is to drop the support for initializers for now ?
from angular.
depends on #69
from angular.
ES6 generates a constructor if there is an extends expression but no constructor. It uses constructor(...args) { super(...args); }
. So if you are generating a constructor you need to ensure that super is called.
For earlier version of the class proposal we used a two phase init. One phase to initialize all properties defined outside the constructor and a second phase to call the constructor.
If a sub class fails to call super they are doing it wrong. You could make that an error in your linter for example.
from angular.
ES6 generates a constructor if there is an extends expression but no constructor. It uses constructor(...args) { super(...args); }.
Interesting, thanks - I had deducted it from the code but I had to verify in the spec. Not needed anymore. (BTW Dart does not inherit ctor by default, we have to update the transpiler).
I'll create a ticket on Traceur with what I have in mind and opened questions so that we wan discuss there before I submit the impl in a PR.
from angular.
@vojtajina can you sync with @vicb on this and sync on status. We want to get to a point where all @field annotations are removed from source base.
from angular.
@vicb can you update on status, and an estimate of how much left to complete...?
from angular.
@naomiblack Traceur plans to have some support for that. I'll discuss with @arv to see if I can submit a PR there. I hope to be able to give an estimate by eow.
from angular.
The PR on traceur is working (google/traceur-compiler#1417). I expect to have to do some updates after review but it should be available in the following days. Then I can concentrate on generate the Dart code for this.
from angular.
@vicb @vojtajina is this one closed or still pending some action...?
from angular.
The PR has been merged to traceur at the end of last week. I need to add dart support to this repo when I'm back from vacations. Please leave open.
Le 4 novembre 2014 14:25:22 GMT+09:00, Naomi Black [email protected] a écrit :
@vicb is this one closed or still pending some action...?
Reply to this email directly or view it on GitHub:
#66 (comment)
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)
- queryParamsHandling is not working as expected
- Working with Normal routes and child routes together HOT 1
- Dynamically generated content is not projected
- FormControl.markAsTouched does not work with OnPush Change Detection
- example puicture not online
- Style binding doesn't account for -webkit prefixes
- Need Simplified Explanation | Services and Dependency Injection | Explanation HOT 1
- Projected content is not hidden when dynamically creating a component if there is nowhere to project the content yet HOT 2
- `ControlValueAccessor` missing `registerOnDisabledStateChanged` method
- Angular 17 SSR does not correctly generate static pages when paired with Firebase HOT 1
- adev is broken on Firefox after xtermjs is loaded and table of contents item clicked HOT 1
- Recursive loadChildren fails in 17, but worked in 16 HOT 5
- Signals nullability checks horribly broken HOT 4
- `withComponentInputBinding()` for route resolves HOT 4
- Picture resource of angular tutorial not available
- JavaScript Proxy construct trap stopped to work since version 15 HOT 2
- pipes API documentation not showing HOT 1
- There is no HttpClient page!
- Animation not initialized when using ZonelessChangeDetection HOT 1
- HTTP Guide don't have a security page
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.