This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:application > | |
<ltng:require styles="/resource/SLDS201/assets/styles/salesforce-lightning-design-system.css" /> | |
<div class="slds" style="margin-top:10px;margin-left:10px;"> | |
<c:AsteroidsList /> | |
</div> | |
</aura:application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
//Fetch the asteroids from the Apex controller | |
getAsteroidList: function(component) { | |
var action = component.get("c.getAsteroids"); | |
var fromDateInput = component.find("fromDate"); | |
var fromDateValue = fromDateInput.get("v.value"); | |
var toDateInput = component.find("toDate"); | |
var toDateValue = toDateInput.get("v.value"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
doInit: function(component, event, helper) { | |
//Fetch the asteroid list from the Apex controller | |
helper.getAsteroidList(component); | |
}, | |
showDetails: function(component, event, helper) { | |
//Get data via "data-data" attribute from button (button itself or icon's parentNode) | |
var url = event.target.getAttribute("data-data") || event.target.parentNode.getAttribute("data-data") | |
}, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component controller="AsteroidsController" implements="forceCommunity:availableForAllPageTypes"> | |
<ltng:require styles="/resource/SLDS201/assets/styles/salesforce-lightning-design-system.css" /> | |
<aura:attribute name="asteroids" type="List" /> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<!-- Use the Apex model and controller to fetch server side data --> | |
<div class="slds-page-header" role="banner"> | |
<div class="slds-media slds-media--center"> | |
<div class="slds-media__figure"> | |
</div> | |
<div class="slds-media__body"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AsteroidsController { | |
//Aura enabled needs to be static | |
@AuraEnabled | |
public static List<AsteroidWrapper> getAsteroids(String fromDate, String toDate) { | |
DateTime startDate; | |
DateTime endDate; | |
List<AsteroidWrapper> asteroidList = new List<AsteroidWrapper>(); | |
System.debug('***fromDate is: ' + fromDate); | |
System.debug('***toDate is: ' + toDate); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AsteroidWrapper | |
{ | |
@AuraEnabled | |
public String str_Asteroid_Name {get;set;} | |
@AuraEnabled | |
public Double str_Magnitude {get;set;} | |
@AuraEnabled | |
public String str_NASA_URL {get;set;} | |
@AuraEnabled | |
public Double str_Estimated_Diameter_Max_Kms {get;set;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AsteroidData{ | |
public cls_links links; | |
public String neo_reference_id; //3127391 | |
public String name; //(2002 LY1) | |
public String nasa_jpl_url; //http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=3127391 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i=1;i<=20;i++) | |
{ | |
if (i % 3 === 0 && i % 5 === 0) | |
{ | |
console.log("FizzBuzz"); | |
} | |
else if (i % 3 === 0) | |
{ | |
console.log("Fizz"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Author: Calvin Noronha--> | |
<!-- Date:May 1 2015--> | |
<apex:page standardController="Contact"> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"></meta> | |
<meta charset="utf-8"></meta> | |
<title>Simple markers</title> | |
<style> |