[SalesForce] Using ObjectType global variable in lightning component

In the doc (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_dynamic_vf_globals_objecttype.htm) it is said that the SobjectType global variable can be used in lightning component, but when i wrote it like stated , I am obtaining an error :

{!$ObjectType['Account'].fields['MaisonMereRecherche__c'].Label}

where MaisonMereRecherche is my custom field on the account object.

I obtained the following error :

Result: [ERROR]: expecting a positive integer, found ''Account'' at column 13 of expression: $ObjectType['Account'].fields['MaisonMereRecherche__c'].Label: Source

When I tried rewriting it like i used to do in VF like this :

 $ObjectType.Account.fields.MaisonMereRecherche__c.Label

I have no error, but it is not showing on my page.

What am I missing here ? Note that i'm coding on the latest API version (38.0)

Best Answer

Ligthning expressions are not the same as visual force expressions.

the list of global value providers are described here

Lightning expression support arrow braces only for accessing arrays, so there expected the integer index