Uncaught TypeError: Cannot call method 'put' of undefined

Tags: angularjs
By : Junhao
Source: Stackoverflow.com

i am facing this issue when i am trying to store data in my angular controller page using the $cookieStore. Are there any additional configurations that i have left out?

function fbLogin($cookieStore){

By : Junhao


You're not actually defining userId anywhere to JavaScript. You're setting a cookie whose value is userid=12345, but then calling validateUser with an unknown variable, userId which has the undefined value.

This video can help you solving your question :)
By: admin