ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.9k

error Cannot read property ‘split’ of undefined

Dec 30 2019 3:07 AM
I work on angular 7 
I get error 
  1. ERROR TypeError: Cannot read property 'split' of undefined  
  2.     at managelocations.component.ts:120  
  3.     at Array.forEach ()  
  4.     at SafeSubscriber._next (managelocations.component.ts:117)  
  5.     at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196)  
  6.     at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134)  
  7.        
error come from this line below :
  1. var loc = this.dataLocation.split(',');     
console.log (dataLocation); 
print  
5.2951916,100.28825170000005 
How to solve this problem 

Answers (2)