I tried to call a component from another component as

<c:NewStudentMaster TeacherId="{!v.teacher.Id}"/>

Here for the first time I am getting value of Teacher.Id as null in controller but when I am trying to call it on some event on another component it is running properly with corresponding TeacherId. Even it is able to print same value for first time on component but not able to fetch this in controller. I am not getting why it is sending null value for the very first time. If I run above component individually from lightning app it is working fine.

1 Answer 1


Just to be clear - this TeacherId data is coming from inside the component and binding back up to a variable in the View?

If you are trying to access it during the init method of the parent component, then it will see null because it's running before the component actually initializes.

I will also point out that for the moment there are some bugs around binding to object properties if Lightning Locker is enabled. Hopefully to be fixed soon.

  • Yes correct componet will load first after that init method im not wrong? Feb 25, 2019 at 4:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .