# How to run a context function on a specific page load?

**URL:** <https://forum.builder.io/t/how-to-run-a-context-function-on-a-specific-page-load/5128>\
**Category:** Technical Questions\
**Tags:** angular\
**Created:** [March 7, 2024, 11:58am UTC](https://forum.builder.io/t/how-to-run-a-context-function-on-a-specific-page-load/5128 "2024-03-07T11:58:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kakshil](https://avatars.discourse-cdn.com/v4/letter/k/22d042/32.png) [@Kakshil](https://forum.builder.io/u/Kakshil)\
**Post date:** [March 7, 2024, 11:58am UTC](https://forum.builder.io/t/how-to-run-a-context-function-on-a-specific-page-load/5128/1 "2024-03-07T11:58:49Z")

</div>

**Builder content link**

> **[Builder.io: Visual Development Platform](https://builder.io/content/9dec1f1ce9d94342a521850c7b6592b2)**
>
> Drag and drop with your components, right within your existing site or app. Build and optimize digital experiences for any tech stack, visually..

**Builder public api key**  
17463bffda934a57b57c1514d1c821f1

**What are you trying to accomplish**  
I want to create two pages. On the second page, I want a context function to be called on init.  
How do I achieve this? They share the same component in the angular app. Do I need a separate component?  
If I directly put code into the ngonInit, it will be called for both pages? Do I need to manage and check states for this?

**Code stack you are integrating Builder with**  
Angular

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [March 8, 2024, 10:54am UTC](https://forum.builder.io/t/how-to-run-a-context-function-on-a-specific-page-load/5128/2 "2024-03-08T10:54:53Z")

</div>

Hello @Kakshil,

We have provided an example in our Angular GitHub repository demonstrating how to pass context and state down to the Builder component. We recommend referring to it at the following link:

> <https://github.com/BuilderIO/builder/tree/main/packages/angular#passing-data-and-context-down>
>
> //github.com/BuilderIO/builder/tree/main/packages/angular
