not able to fetch JSONP data from my own api in angularjs

后端 未结 1 395
猫巷女王i
猫巷女王i 2021-01-24 03:17

I am trying to fetch data from my own api but was not able to succeed in fetching the same to vegdata variable... here is the controller code

    $scope.filterTe         


        
1条回答
  •  迷失自我
    2021-01-24 03:27

    Your response should be like this:

    yourCallBack([{"name": "Tuar", "image": "0.0", "fat": "0.0", "alias": [{"vegname": "Tuar ", "language": "Hindi"}, {"vegname": "Red Gram", "language": "English"}, {"vegname": "Cajanus cajan", "language": "Botanical Name"}], "protein": "0.0", "energy": "0.0", "carbohydrates": "0.0"}]);
    

    With yourCallBack being retrieved from callback query string. I don't know how to do it with python, in asp.net mvc I would to something like this:

    string callback = Request.QueryString["callback"];
    

    0 讨论(0)
提交回复
热议问题