# spp.params **Repository Path**: mirrors_stephenplusplus/spp.params ## Basic Information - **Project Name**: spp.params - **Description**: An easy way to save URL parameters to localStorage in your Angular application. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-23 - **Last Updated**: 2026-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # spp.params > An easy way to save URL parameters to localStorage in your Angular application. ## Demo Check out a really awesome sample application [here](http://embed.plnkr.co/FivsKkrRbIkuhfNqTHdG/preview). ## Using spp.params Using [Bower](http://bower.io), head to your nearest terminal and tap: ```bash $ bower install spp.params --save ``` - Include `spp.params/SessionService.js` in your HTML. - Add `spp.params` as a dependency of your Angular module. ## Sample Usage Follow along with the sample application below to see how to use `spp.params`. ```js angular.module('yourApp', ['spp.params']). config(['SessionServiceProvider', function (SessionServiceProvider) { // You must define a key where the parameters will be saved into // localStorage. SessionServiceProvider.localStorageId = 'url-parameters'; // SessionService allows you to customize the way warning messages are // displayed. Here, we just have a simple wrapper around the function that // will be called, `NotifierService`. SessionServiceProvider.NotifierService = function (message) { console.log('This is a custom warning message!', message); }; // You must specify `parameters` as an array of objects in the following // format... // // name {string} The case-insensitive url parameter you want to cache. // required {boolean} Should your application display a warning if this // parameter isn't specified? SessionServiceProvider.parameters = [ { name: 'userId', required: true }, { name: 'unicornId', required: false } ]; }]). run(['$rootScope', 'SessionService', function ($rootScope, SessionService) { // You must choose when to detect and store parameters. Here, we're running it // as soon as the application runs... SessionService.readParams(); // ...as well as every time the route changes. $rootScope.$on('$routeChangeSuccess', SessionService.readParams); }]); ```