Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
Angular 2 processing order

I am new to Angular and am trying to understand the order it processes a files applications. So, from my understanding of the order: 1- main.ts is processed and, and the bootstrap method belonging to the platform that is imported accepts the root module file as an argument. 2- app.module.ts is processed which will import all of the necessary packages and application files required for the application. Here is also where all of the different components and directives and what not of the application are declared for use in the application, and where the applications root component is bootstrapped leading to the component tree model being rendered from the top down. 3 - This is where I am struggling to fully understand whats happening.

So beginning with the root component being rendered, Angular will follow the parent child path down the tree of the root components child components and render them in order? So, say after the AppComponent declaration comes the BookItemComponent followed by the BookItemList component and lastly a directive called FavoriteDirective. So AppComponent is started and renders the parent custom DOM element in the body of the applications markup. Then, nested within this comes the BookItemComponent which creates another custom DOM element called . In this components class we have an input selector called bookItem. Then, nested within this comes the BookItemList component, which contains an array of book items called bookItems. Finally, the FavoriteDirective which just handles some simple host binding to create a class for the host element.

So my question in a nutshell - Say the BookItemComponent is rendered but it has some bindings within its markup that is dependent on code from the BookItemListComponents class or the FavoriteDirectives class. Would Angular skip ahead of BookItem and look at those files? Or would Angular pause its processing of the BookItemComponent class, skip ahead and look for a data match for the item it cant interpret yet? Or maybe stop and iterate to the next component and move forward in order and once it finds the data it needed for the items it couldn't interpret yet then return to fill in the gaps? I am finding it hard to follow the path of rendering when I see this happen. Maybe I am just thinking about it incorrectly?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Not sure what you mean with "find the data". Binding are explicit where to look for data. If a field a binding refers to doesn't have data yet, then it either throws if this makes the expression invalid like {{person.name}} when person is null (you can work around using {{person?.name}} to avoid an exception). Otherwise Angular will "find" the data after it becomes available and change detection is run.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!