---
title: "ng-repeat attribute not working"  
description: "ng-repeat attribute not working"  
author: "Takeshi Okada"  
published: 2015-03-19  
updated: 2015-03-19  
canonical: https://www.mindstick.com/forum/23032/ng-repeat-attribute-not-working  
category: "angular js"  
tags: ["javascript", "angularjs ng repeat", "javascript library"]  
reading_time: 2 minutes  

---

# ng-repeat attribute not working

Hi I’m new in [angularjs](https://www.mindstick.com/forum/33926/use-angularjs-without-scope-in-mvc) I am try to [print](https://www.mindstick.com/blog/301752/types-of-3d-printing-technology) [country](https://yourviews.mindstick.com/view/85543/do-you-think-that-french-will-be-islamic-country) list and state list. But my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) is not [working proper](https://www.mindstick.com/forum/23038/why-angularjs-controller-is-not-working-proper).

At the time one things is print. If you want to print country then you write print country code as first line and if you want to print state list then you write code print state list as first line according to my code.

**My code is here**

```
<h1>Sample Application</h1>    <div ng-app="" ng-init="countries=[{locale:'en-IN',name:'India'},{locale:'en-GB',name:'United Kingdom'},{locale:'en-FR',name:'France'}]">        <h2>List of Countries with locale:</h2>        <ul>            <li ng-repeat="country in countries">{{ 'Country: ' + country.name + ', Locale: ' + country.locale }}</li>        </ul>    </div>     <div ng-app="" ng-init="states=[{language:'Hindi',name:'Uttar Pradesh'},{language:'English',name:'Banglore'},{language:'Telgu',name:'Tamil Nadu'}]">        <ul>            <li ng-repeat="state in states">{{'State: '+state.name+', Language: '+state.language}}</li>        </ul>    </div>    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
```

What is [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) in my code I can’t understand please help me.

Thanks in advance.

## Replies

### Reply by Anonymous User

Your fault is you use ng-app attribute two times it is not correct way because ng-app starting point of angularjs and you know very well everything starting point is one.

**So Please try this code:**

```
<ul ng-init="countries=[{locale:'en-IN',name:'India'},{locale:'en-GB',name:'United Kingdom'},{locale:'en-FR',name:'France'}]">            <li ng-repeat="country in countries">{{ 'Country: ' + country.name + ', Locale: ' + country.locale }}</li>        </ul>        <ul ng-init="states=[{language:'Hindi',name:'Uttar Pradesh'},{language:'English',name:'Banglore'},{language:'Telgu',name:'Tamil Nadu'}]">            <li ng-repeat="state in states">{{'State: '+state.name+', Language: '+state.language}}</li>        </ul>
```


---

Original Source: https://www.mindstick.com/forum/23032/ng-repeat-attribute-not-working

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
