nl_tokens: / * Add value to storage - key : key to retrieve data - value : value of data - keep : * optional * boolean to keep value indefinitly ( localStorage ) or temporarily ( sessionStorage )
pl_tokens: function ( key , value , keep ) { // Get storage type keep = ( typeof keep === 'undefined' || typeof keep !== 'boolean' ) ? false : keep ; var storageType = keep ? 'localStorage' : 'sessionStorage' ; // Convert undefined values to null if ( angular . isUndefined ( value ) ) { value = null ; } else if ( angular . isObject ( <mask> ) || angular . isArray ( value ) ) { value = angular . toJson ( value ) ; } // Set web storage webStorage = $window [ storageType ] ; // Add data to storage webStorage . setItem ( key , value ) ; return true ; }