angularjs throws 'undefined' error if cookie name contains hyphen (dash) in it -


I am using cookies to read cookies. Although one of my cookies has a hyphen / dash in which Inbetween When I tried to do this, the person throws an 'undefined' error event until a cookie exists. Although this cookie names are not being used without hyphen / dash in it.

P> Because 'pd' is because hyphen is zero operator, javascript interpreter thinks you are trying. Subtracting When the property name contains special characters, you need to wrap it in quotation marks and use it like this:

  $ cookies ["AUTH-PD-ID"]    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -