Skip to content

Instantly share code, notes, and snippets.

@pchittum
Created February 9, 2015 11:43
Show Gist options
  • Select an option

  • Save pchittum/60668366e4004cbefed5 to your computer and use it in GitHub Desktop.

Select an option

Save pchittum/60668366e4004cbefed5 to your computer and use it in GitHub Desktop.
Example code for force:input/outputField error
({
doInit: function(component, evt, helper) {
console.log('entered init');
var action = component.get("c.getAccount");
console.log('Apex METHOD:')
console.log(action);
action.setCallback(this, function(a) {
console.log('entered callback');
var retValue = a.getReturnValue();
console.log(retValue);
component.set("v.account", retValue);
console.log('finished callback');
});
console.log('about to enqueue action');
$A.enqueueAction(action);
console.log('finished init');
},
})
<aura:component controller="AccountController">
<aura:attribute name="account" type="Account"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<ui:inputText value="{!v.account.Name}"/>
</aura:component>
<aura:component controller="AccountController">
<aura:attribute name="account" type="Account"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<force:inputField value="{!v.account.Name}"/>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment