Skip to content

Instantly share code, notes, and snippets.

@ninjacato
Created February 25, 2013 08:35
Show Gist options
  • Save ninjacato/5028518 to your computer and use it in GitHub Desktop.
Save ninjacato/5028518 to your computer and use it in GitHub Desktop.
var App = angular.module('myModuleName', ['ngCookies']);
function SomeFunc($scope, $cookies) {
$cookies.NameOfMyCookie = "Setting a value";
alert($cookies.NameOfMyCookie);
}
@Qoraiche
Copy link

Qoraiche commented Oct 9, 2016

or simply :
put:
$cookies.put('cookiekey', 'cookieval');
get :
var cookie val = $cookies.get('cookiekey');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment