I have searched about sales force Lightning ..That time I got one Intersting Link
<aura:iteration> won't work with your database object untill u wire up a controller class in your component and write the method inside the controller to fetch the data.
For Information please refer below link https://developer.salesforce.com/forums/?id=906F0000000B37pIAC
I want to know the exact reason beyond this line ???!!!...
================================================
<aura:component controller="SamplePic">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="User" type="User[]"/>
<center>
<p> Simple Image Component</p></center>
<aura:iteration items="{!v.User}" var="User">
{!User.Id}
<br/>
{!User.smallPhotoURL}
<br/>
</aura:iteration>
=========================================
({
doInit : function(component, event, helper) {
alert('page loading calling @@@');
var action=component.get("c.SamplePic1");
action.setCallback(this,function(a){
var state=a.getState();
if(state==='SUCCESS'){
alert('success value');
//alert('list value ::::::'+JSON.stringify(a.getReturnValue()));
component.set("v.User",a.getReturnValue());
}
});
$A.enqueueAction(action);
}
})
==========================================
public class SamplePic {
@AuraEnabled
public static String photoURL {get;set;}
@AuraEnabled
public static List<User> SamplePic1() {
system.debug('::::: usr method is calling :::');
return[SELECT Id,smallPhotoURL FROM User];
}
}