JavaLearner1 JavaLearner1 - 3 months ago 8x
AngularJS Question

AngularJS Cookies - Cookies saved in Browser but not displaying

I have injected the cookies and i am saving the value in cookies like this,

$ = "Alfred";
console.log("cookie " +$;

and in HTML i display


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..


you need to have a scope variable to display it

$ = "Alfred";
$scope.cookiname = $ ;


<div>Name: {{cookiname}}</div>

Here is the working App