Why does <ui:button>
work but <lightning:button>
does not work?
Component:
<aura:component>
<ltng:require
styles="{!$Resource.SLDS212 + '/assets/styles/lightning-design-system-ltng.css'}"
scripts="{!$Resource.jsLibraries + '/jsLibOne.js'}"
afterScriptsLoaded="{!c.scriptsLoaded}" />
<ui:button label="myButton" press="{!c.doSomething}"/>
<lightning:button name="myButton" onclick="{!c.doSome}"/>
</aura:component>
Controller:
({
doSomething: function(cmp, event, helper) {
var button = event.getSource().get("v.label");
alert(button);
},
doSome: function(cmp, event, helper) {
var button = event.getSource().get("v.name");
alert(button);
}
})