TypeError Cannot read property post of undefined

TypeError Cannot read property post of undefined

AngularJS: If you are trying to post data to the server using AngularJS http post and getting below error:

  • It means $http has not been registered with controller. Below code will throw above exception:

AngularJS TypeError Cannot read property post of undefined

  • Solution: Register $http service to the controller will resolve the issue:

AngularJS TypeError Cannot read property post of undefined

  • Complete working code:

  • For more information about submit post data using AngularJS please follow use this linkĀ 

Leave a Reply

Your email address will not be published. Required fields are marked *