Reputation: 627
I have injected the cookies and i am saving the value in cookies like this,
$cookies.name = "Alfred";
console.log("cookie " +$cookies.name);
and in HTML i display
{{name}}
the cookies are getting saved and displayed in console, But in HTML it is not getting displayed. I have checked the chrome browser too, the cookies are saved in localhost..
Upvotes: 0
Views: 62
Reputation: 222700
you need to have a scope variable to display it
$cookies.name = "Alfred";
$scope.cookiname = $cookies.name ;
In HTML
<div>Name: {{cookiname}}</div>
Here is the working App
Upvotes: 1