1

I have this array

$scope.critere_cuisine = [
    {"name" : "Assiettes plates",
    "etats" : $scope.etats
  }]

which refers to

$scope.etats = [{ "text": "Bon", "checked": true },
  { "text": "Moyen", "checked": false },
  { "text": "Mauvais", "checked": false }];

But i don't manage to make it work, where am i wrong ?

3
  • 2
    Where you are wrong is that you haven't told us what it means to you to 'make it work', nor have you shown any of the code where you attempted to use the data structures you created. Commented Apr 27, 2016 at 12:48
  • 1
    what about it doesn't work? are you getting an error? Commented Apr 27, 2016 at 12:48
  • when i do console.log(JSON.stringify($scope.critere_cuisine)) i get [{"name":"Assiettes plates","etats":""}] Commented Apr 27, 2016 at 12:50

1 Answer 1

1

You probably defined etats below critere_cuisine. If you declare etats before critere_cuisine it should work fine.

Sign up to request clarification or add additional context in comments.

1 Comment

It's no problem. Everybody has these moments. Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.