jquery - Angular updates data model with wrong values -


I'm trying to get data from YELP - to make sure my template was working, I NG-Dual Container to a Model Both methods do not work, do I suspect that I am updating my list with $ scope.list which contains incorrect data and is not binding. Using some of the blank API properties, the view does not update any ideas?

  & lt; Div ng-repeat = "item in list" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-lg-7 col-md-7" & gt; & Lt; A href = "#" & gt; & Lt; Img class = "img-responsive" src = "http://placehold.it/700x300" alt = "" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div class = "col-lg-5 col-md-5" & gt; & Lt; H3 & gt; {{Item.id}} & lt; / H3 & gt; & Lt; H4 & gt; Sub-title & lt; / H4 & gt; & Lt; P & gt; Advertising for advertising Thank you for your life, thanks for your life. Monitoring, Editing and Exiting of SEED Photographers, Inter Morris Ultrisers, UT Simplers Polyteres, Phillipines Anime & Lt; / P & gt; & Lt; One class = "btn btn-primary" href = "#" & gt; View project & lt; Span class = "glyphin glyphine-chevron-right" & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; Var BlogWhiteView Controller = Angular Modules ('BlogApavist Controller', []); BlogAppViewController.controller ('post_View_Ctrl', function ($ radius, $ http, $ routeParams, $ location) {$ scope.list = [{'Title': 'NexusS', 'name': 'Fast Bus Fast with Nexus Fast 'with the Nexus S. Fast', 'link': "data: WMB"}, {'title': 'NexusS', 'name': 'link': "Data: WMB "}] Get get help () {return $ .exx ({url: '/ getyelp'})}} ////////// $. When (get help ()) .Done (function (Result) {This.yelp_Data = results.businesses; $ scope.list = this.yelp_Data; console.log ($ scope.list);});});  

The main problem I see is that you use jQuery's AJAX request Are the angular cycle runs out.

So if you want to continue to use jQuery (though I would suggest using the service), then you need to call after modifying the scope values ​​so that the angular structure becomes aware of the changes about.

$ When (getYELP ()) (Function (result) {this.yelp_Data = results.businesses; $ scope.list = this.yelp_Data; console.log ($ Scope.list); if (! $ Scope. $$ phase & amp;! $ Scope. $ Root. $$ step) {$ scope. $ Apply ();}});

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -