Skip to content

victorhugom-zz/fortune-cookie

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bower version open issues license

<fortune-cookie>

The fortune-cookie element can be used to set and read cookies. You should have one fortune-cookie element per cookie you want to use, defined in many elements by its name property. You can then read the value of the cookie, or save the cookie by setting the value attribute or explicitly calling the save method.

Demo and API docs

Beast features

Choose to handle value as Object or String

Get when cookies expires with on-fortune-cookie-expired observer

Get when cookies loads empty with on-fortune-cookie-load-empty observer

Example

    <fortune-cookie
      name="mycookie"
      value="{{object}}"
      on-handle-value-as="Object"
      on-fortune-cookie-expired="_onExpired"
      on-fortune-cookie-load-empty="_onLoadEmpty">
    </fortune-cookie>

Save:

    this.$.mycookie.save();

Realod:

    this.$.mycookie.load();

Packages

No packages published

Languages

  • HTML 100.0%