Giter Club home page Giter Club logo

app-cookies's Introduction

<app-cookies>

Element to manage cookies across your app. app-cookies read values from cookie data automatically and serves it to client. Settting and resetting of values are not automatic and need to be triggered by code.

Installation

npm install --save @elifent/app-cookies

In an html file

<html>
  <head>
    <script type="module">
      import "@elifent/app-cookies/app-cookies.js";
    </script>
  </head>
  <body>
    <app-cookies key="location" data="US"></app-cookies>
  </body>
</html>

In a Polymer 3 element

import { PolymerElement, html } from "@polymer/polymer";
import "@elifent/app-cookies/app-cookies.js";
class SampleElement extends PolymerElement {
  static get template() {
    return html`
      <app-cookies id="location" key="location" data="{{location}}"></app-cookies>
      <span>{{location}}</span>
      <input type="text" value="{{newvalue}}">
      <input type="button" value"Set Location" on-click="set">
      <input type="button" value="Unset Location" on-click="unset">
    `;
  }
  static get properties() {
    return {
      location: {
        type: String,
        value: "US"
      },
      newvalue:{
        type: String,
        value: null
      }
    };
  }
  setLocation(){
      this.$.location.set(this.newvalue);
  }
  unsetLocation(){
      this.$.location.unset();
  }
}
customElements.define("sample-element", SampleElement);

Installation

  git clone https://github.com/elifent/app-cookies
  cd paper-avatar
  npm install
  npm install -g polymer-cli

Running the demo locally

  polymer serve --npm
  open http://127.0.0.1:<port>/components/app-cookies/demo/

Found issues? Let me know

app-cookies's People

Contributors

aneesshameed avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.