Giter VIP home page Giter VIP logo

Comments (4)

JoostK avatar JoostK commented on May 10, 2024

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.

inmativ avatar inmativ commented on May 10, 2024

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.

pkozlowski-opensource avatar pkozlowski-opensource commented on May 10, 2024

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.

inmativ avatar inmativ commented on May 10, 2024

Understood. Overall this is a good compromise.
Thank you for your time!

from angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.