Bound and Unbound Expressions in Lightning Components

When we work with components, the first thing we do is declaring the attributes and initialize them. We use expressions for initializing our components. There are two types of expressions, bound and unbound that are used to perform data binding in Lightning Components.

Bound Expression: Bound Expression is represented as {!v.str}. Whenever the value of the string is changed, this expression will reflect the change and also affect the components where it is used, we can say the value change dynamically through this expression.

Unbound Expression: Unbound Expression is represented as {#v.str}. Whenever the value of the string is changed, this expression will not reflect the change, we can say the value remains static through this expression.

Here is an example of lightning component with Bound and Unbound Expressions:

Sample Component:

<aura:component>
    <aura:attribute name="str" type="string" default="Hello World!"/>
    <ui:outputText value="Enter a string value : "/>
    <ui:inputText value="{!v.str}"/>
    <br/>
    <ui:outputText value="Unboud Expression : "/>
    <ui:outputText value="{#v.str}"/>
    <br/>
    <ui:outputText value="Bound Expression : "/>
    <ui:outputText value="{!v.str}"/>
</aura:component>

Output:
bound-and-unbound-expressions

The value in bound expression variable changes on change of the input, but the value of unbound expression remains the same.

Custom Logout Page in Salesforce

Now you can direct users to a specific logout destination that maintains your own branding experience after they log out of Salesforce.

To enable this follow below steps:
Goto Setup | Administer | Security Controls | Session Settings, navigate to Logout Page Settings section and set the Logout URL of the custom logout page.
salesforce-custom-logout-page-settings

Skype for Salesforce

Skype for Salesforce integrates Salesforce and Skype for Business, so your sales and service reps can send and receive instant messages and see colleague’s availability without leaving Salesforce. If Notes is enabled in your org, reps can also save IM chats as notes and attach them to Salesforce records. Skype for Salesforce is available only if your business has a Microsoft Office 365 Enterprise plan that includes Skype for Business Online, or a Skype for Business Online license.

Note: Skype for Salesforce is available only in Lightning Experience.

From Setup, enter Skype for Salesforce in the Quick Find box, then select Skype for Salesforce.

Enable Skype chat

Create a permission set with Skype Conversation permission enabled, for Skype users and assign it to them.

  • From Setup, enter Permission Sets in the Quick Find box, then select Permission Sets.
  • Either create a permission set or select an existing one.
  • Select System Permissions | Edit.
  • Select the Skype Conversation permission.
  • Click Save.
  • Click Manage Assignments.
  • Select which users you want to give access to Skype for Salesforce.
  • Click Add Assignments.

When Skype for Salesforce is enabled, users who have the Skype Conversation permission see a banner prompting them to sign in to Microsoft Office 365.

Click Connect Office 365 and enter your Office 365 login credentials. After link your Microsoft Office 365 account to Salesforce, you can see who is online and chat.

Get User Browser Information in Lightning Component

We can use $Browser global value provider to get information about the hardware and operating system of the browser accessing the application.

Use $Browser in Lightning Component:

<aura:component>
    {!$Browser.isTablet}
    {!$Browser.isPhone}
    {!$Browser.isIPad}
    {!$Browser.isIPhone}
    {!$Browser.isWindowsPhone}
    {!$Browser.isIOS}
    {!$Browser.isAndroid}
    {!$Browser.formFactor}
</aura:component>

Use $Browser in Lightning JS Controller:

doInit : function(component, event, helper) {
    var device = $A.get("$Browser.formFactor");
    alert("You are using a " + device);
},

Get User $Locale in Lightning Component

The $Locale global value provider returns information about the current user’s preferred locale.

Use $Locale in Lightning Component:

<aura:component  implements="flexipage:availableForAllPageTypes,force:appHostable">
    Language : {!$Locale.language}
    Timezone : {!$Locale.timezone}
    Country : {!$Locale.country}
    Currency : {!$Locale.currency}
</aura:component>

Use $Locale in Lightning JS Controller:

doInit : function(component, event, helper) {
    var locale = $A.get("$Locale.country");
    alert("Your Country " + locale);
},