• Gonzalo Huerta Cánepa
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am trying to use the storage service in my app.
What I did was to create an app template that has the following:
<aura:set attribute="auraPreInitBlock">
        <!-- Note that the maxSize attribute in <auraStorage:init> is in KB -->
        <auraStorage:init name="mystorage"
                          maxSize="4096"
                          clearStorageOnInit="false"
                          defaultExpiration="3600"
                          debugLoggingEnabled="true"/>
    </aura:set>
Then my app uses that as template.
One of the component of the app is trying to access the storage using $A.storageService.getStorage("myStorage"); but I get an error saying that $A.storageService is undefined.
I put a console.log and indeed it is undefined, but if I open a console in the same page (Using developer tools in chrome) and I execute console.log($A.storageService) then it works OK.
So my guess is that the scope of the $A variable changes btween the app and each component.
Any ideas?
 
Hi guys,
My lightning component does not work in a pre-release sandbox with LockerService enabled.
Are there anyone face the same issue. Could you please share your solution or advice on how to resolve this issue.

Many thanks
Regards,
Yang