javascript - multiple values from cookie to var in angular -


my code looks like:

  var ietms = $cookies.get('items'); 

i can values back, there multiples such as:

testvalue1|testvalue2|testvalue3 

i want able split 3 items lets multiple vars, like:

var ietms = $cookies.get('items')[0]; var ietms2 = $cookies.get('items')[1]; var ietms3 = $cookies.get('items')[2]; 

but split value based on '|' separating values

if returned data string, can use var splititems = ietms.split('|') create 1 array consisting of individual values. hard if applies question, because return type of testvalue1|..|.. unclear


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -