I was planning to create an extensible component with pre-defined layout to let the abstract component as a template. So my extended component can focus on the content.
But I'm keep getting the error:
Access Check Failed! AttributeSet.get(): attribute 'currentUserName' of component 'markup://ui:outputText {1036:0}' is not visible to 'markup://aura:expression {1014:0}'.
myAbstractCmp.cmp:
<aura:component abstract="true" extensible="true" >
<aura:attribute name="currentUserName" type="String" access="global"/>
<aura:attribute name="customMarkups" type="Aura.Component" access="global" description=""/>
<div class="custom-container">
<ui:outputText value="This is the content of abstract component."/>
{!v.customMarkups}
</div>
{!v.body}
extendedCmp.cmp
<aura:component extends="c:myAbstractCmp" implements="flexipage:availableForAllPageTypes" >
<aura:attribute name="currentUserName" type="String" access="global" default="Test User"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:set attribute="customMarkups">
<ui:outputText value="{!'Child attribute set to the parent component: '+v.currentUserName}"/>
</aura:set>
<ui:outputText value="{!'Child attribute used in the child component: '+v.currentUserName}"/>
</aura:component>
extendedCmpController.js
({ doInit : function(component, event, helper) { component.set("v.currentUserName", "Karen Stone"); } })
Checked the document and the other similar questions, but still not understand what's wrong in my code.
UPDATE: Why the "currentUserName" attribute I want to set to the Parent Component as the content of its layout is not visible. Why check the attribute on ui:outputText component rather than my extended component?
Tried to update the API version in the Bundle Version Setting to the latest: 43.0. And the UI error dialog only shows up when I enabled the Lightning Component Debug Mode.
Or if there have any other way for layout template for a component not for Lightning Page?