0:10
in this video we are going to see
0:15
usage in Salesforce lightning or a
0:25
assign a variable value and also we can
0:28
get the value that is stored in local
0:33
in Salesforce lighting or a component
0:37
in order to assign a value for using
0:40
local storage then we have to use local
0:44
storage dot set item method
0:47
in order to get value from the local
0:50
storage then we have to make use of
0:52
local storage Dot get item
0:58
so for this demo I created a simple
1:00
lightning or a component
1:01
I have lightning Aura Handler
1:05
and then I'm using the init
1:08
init Handler so whenever the lightning
1:12
Aura component is called this init
1:16
called and then it will call this action
1:19
so I'm calling a method with the name
1:25
controller JavaScript
1:27
and in my controller JavaScript first I
1:30
am assigning local storage dot set item
1:33
off so the name of the variable is going
1:35
to be example item and the value I'm
1:38
assigning is testing and in order to
1:41
just for testing purpose I am
1:45
adding a console.log statement example
1:49
item is local storage dot get item of
1:52
the variable name that is nothing but my
1:57
so it is very similar to map data type
1:59
so we can use the get item and we can
2:02
pass the key and then we can get the
2:03
value called testing here since I am
2:06
using the key as example item
2:10
so my component is saved so two
2:13
important methods we have to remember is
2:15
set item to assign a variable value
2:18
get item to get a value for a specific
2:22
key it is very similar to map map is the
2:26
best data type to compare for this so
2:28
that it will be easy for us to keep in
2:30
mind but we have to use set item and get
2:35
so let's see this so I'm going to
2:38
refresh my page once my ARA component is
2:47
so example is listings
2:51
so using uh this code as a referencer
2:55
please try to build as per your business
3:00
use cases like using this
3:05
talking from Aura component to a
3:10
so that since it is like an in iframe
3:16
customers were able to or the developers
3:19
were able to pass variable values from
3:22
one application to another application
3:33
please check the video description I
3:36
have shared my blog post from my blog
3:38
post you can get this sample code as a
3:40
reference and you will be able to build
3:53
I hope it was helpful
4:02
thank you for watching