Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ng-local-storage-service
Advanced tools
Readme
An Angular service for client-side set, get, remove, bind, and clean of local storage mechanisms. It provides fallbacks to cookies or in-memory storage based on client capabilities and service configuration.
##Dependencies
cookieFallback
is enabled.##Features
##Basic Setup
var app = angular.module('yourApp', ['local-storage.service']);
app.controller('yourController', function($scope, $store){ ... });
##Configuration Options
The default configuration is:
To override the default configuration options, configure the module with an options argument during application configuration:
app.config(['$storeProvider', function ($storeProvider) {
$storeProvider.configure({
cookieFallback: false,
useSessionStorage: true
});
}]);
##Basic Usage ###Binding
// Binding it to a $scope.variable - the params ($scope, varName, defaultValue(optional))
$store.bind($scope, 'viewType', 'cardView');
// To change the variable both locally in your controller and in storage
$scope.viewType = "ANYTHING";
###Unbinding
// Unbinding and remove a $scope.variable
$store.unbind($scope, 'viewType');
###Set
// Set a key-value pair in storage
$store.set("key", "value");
###Get
// Get a value from storage
$store.get("key");
###Has
// Determine if a key is present in storage
$store.has("key");
###Remove
// Remove a key-value pair from storage
$store.remove("key");
###Clear
// Clear all key-value pairs from storage
// Note: this is not supported for cookie storage as there is no $cookie service support for such an action.
$store.clear();
##Additional Methods These methods were primarily implemented for testing purposes, but they may be useful in special scenarios and are part of the exposed API.
// Get the configuration hash
$store.getConfiguration();
// Get the value of the supported boolean. This value is used by the service for picking
// the appropriate storage mechanism to use.
$store.getSupported();
// Set the supported boolean. This value is used by the service for picking
// the appropriate storage mechanism to use.
$store.setSupported(false);
// Get the supported storage interface (localStorage or sessionStorage). This variable will be undefined if the Storage interface is not supported.
$store.getStorage();
// Get the in-memory storage object.
$store.getMemStore();
##Development
After forking you should only have to run npm install
from a command line to get your environment setup.
After install you have two gulp commands available to you:
gulp js:lint
gulp js:test
FAQs
[![Bower Version](https://img.shields.io/bower/v/ng-local-storage-service.svg)](https://github.com/justinsa/angular-local-storage-service) [![NPM Version](https://img.shields.io/npm/v/ng-local-storage-service.svg)](https://www.npmjs.com/package/ng-local-
The npm package ng-local-storage-service receives a total of 0 weekly downloads. As such, ng-local-storage-service popularity was classified as not popular.
We found that ng-local-storage-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.