Comments (4)
Angular components are rendered in two phases: the first pass only creates elements/components, but does not process template bindings. One reason for this is that e.g. template references can capture an element forwards in the template.
The proposed input syntax does avoid the problem with strictPropertyInitialization
though, as fields are always assigned using field = input.required<string>()
, of which the type is string
because .required
was used.
from angular.
Thank you for your reply. I didn't know about such nuances with the template.
What happens if you use such a mandatory input in the constructor? Will the values be ready by then? Or will an error be thrown? Will we be able to initialize other fields in the constructor using the values of the required inputs?
from angular.
What happens if you use such a mandatory input in the constructor? Will the values be ready by then? Or will an error be thrown?
In the current proposal it will throw.
Will we be able to initialize other fields in the constructor using the values of the required inputs?
No. But you will be able to use those in a reactive context (ex. computed
or a direct reference in a template).
from angular.
Understood. Overall this is a good compromise.
Thank you for your time!
from angular.
Related Issues (20)
- angular ssr GCP function not working HOT 4
- Brand new app failing with: NG0203: inject() must be called from an injection context such as a constructor HOT 6
- bug(matSort): matSort used with Angular animations is leaking memory HOT 2
- Dead link HOT 3
- ReferenceError intersectionObserver(@angular/core/fesm2022/core) HOT 3
- 404 in "Try out inject" HOT 2
- @HostBinding("class.some-class") with Signal<boolean> = computer(() => {}); HOT 2
- Update ngSwitchCase docs HOT 1
- possible memory leak when using `:host-context()` selector HOT 7
- Provide the ability to test directives that contain input signals without wrapper components HOT 1
- InputSignal with booleanAttribute cannot be used as an attribute HOT 3
- Support InputSignal for ComponentRef HOT 2
- Client hydration breaks in module bootstrap with AOT disabled HOT 1
- The generator DOES NOT automatically add the ProductAlertsComponent to the AppModule. HOT 2
- Angular SSR 17 providers and GET calls not working HOT 5
- Parent :leave animation breaks the state of child animation
- Page not found HOT 2
- Cron Job HOT 2
- Zone.js propagates false positive unhandled rejections HOT 6
- Create or define type for animation transition input
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.