javascript - AngularJS ng-repeat - http.gs retrieving data, but not displaying -
I am new to angular and am trying to integrate it into my application. I have a simple Here's my HTML: when viewed in the browser, all of which are displayed They are: It seems that My code can see that there are 3 countries, like when I add or remove from my JSON file, the list given in HTML is modified accordingly, however, the contents of JSON are not being displayed. < P> I forgot to return data from my * * Update *************** **************************************************************************************************** **************************************************************************************************** **** I think I know what the problem might be. My app uses an HTML templateting framework that uses the swig. Using JSON file {{}} .. Can it cause confusion with angular? ** UPDATE ************************************** > to and: < {{country.name}} has a population of {{country.population}} pre to: then the correct values are displayed. Get data in the array of objects like $ http.get Trying to use JSON file, which displays the mailing content in
ng-repeat I get: < Previous>
$ scope.countries = []; $ Http.get ('/ resources / data / countries-report.json'). Success (data) {$ scope.countries = data.countries; // Alert (JSON.stringify ($ scope.countries)); Console.log (data.countries); console.log (data.countries.population) "{{" Name ":" France "," Population ":" Joe "," surName ":" blogs "," country ": {error ('error';}) 63.1 "}, {" name ":" span "," population ":" 52.3 "}, {" name ":" United Kingdom "," population ":" 61.8 "}]}
.get ??
var app = angular Module ("app", []);
var app = angular Module ('app', []). Config ($ interpolletepayer) {$ interpolateProvider.startSymbol ('{[(' ') .endSymbol ('}]} '}}}
& lt; li ng-repeat = "country in country" & lt; / li & gt;
[{id: 1, ima: gh.jpg, data: [[anyid: 1, my: w , Ki: y}]}, {id = 2, etc. Interpretation: jh.jpg}]
Comments
Post a Comment