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 $ 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 "}]}
Here's my HTML:
li ng-repeat = "Country in Country" & gt; {{country.name}} in {{country.population}} Population is when viewed in the browser, all of which are displayed They are:
-
- has a population of
- its population is
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 .get ??
* * 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 ************************************** >
var app = angular Module ("app", []); to
var app = angular Module ('app', []). Config ($ interpolletepayer) {$ interpolateProvider.startSymbol ('{[(' ') .endSymbol ('}]} '}}} and: < {{country.name}} has a population of {{country.population}} pre & lt; li ng-repeat = "country in country" & lt; / li & gt;
to:
- -
- repeat = "country in the country"> population of {{{country.name}}} {{ .po]}} is
then the correct values are displayed.
Get data in the array of objects like
[{id: 1, ima: gh.jpg, data: [[anyid: 1, my: w , Ki: y}]}, {id = 2, etc. Interpretation: jh.jpg}]
Comments
Post a Comment