Ok, stupid question but I have searched and could not find this anywhere…
Q: How to you get (what is the expression syntax of) the ID of the record which is displaying the component / app?
I have read that I need to implement the interface here force:recordTab
Q: How is Lightning aware of what record you are on if you embed it in
Salesforce1? (i.e. how do you get the ID of the record you are on like
in a standard controller)?A: Your component just needs to implement
the force:recordTab interface and the record and recordId will be
automatically injected when your component is wired into record home.
from the FAQ: https://developer.salesforce.com/page/Lightning_FAQ
Since found to be incorrect (see answer)
but beyond that I could find no documentation on this interface or anything in the lightning component developer guide that discusses this.
Basically, on init I need to grab the ID of the record whose detail page is being displayed.
Sorry for the newbie question but you would think something this simple would be out there in the open…..
Best Answer
Ok, I found it after doing some serious reading of the Winter '16 release.
You need to implement the interface:
in your component and then you can access the record id via the following expression
An example component would be: