0

I am writing a website for my school that, among other things will display departmental changes. These changes are already gathered with a script I wrote. To improve workflow I want the impelmentation of the data onto the website to be automated so while the script automatically sens an email to department heads it also saves the information as JSON data and uploads it to the server where I use angularJS' $http.get to save it into the $scope

var integrationFactory = function($http) {
    var factory = {};
    factory.getNotes = function() {
        return $http.get('/ci/json_releasenotes.json');
    };

return factory;
};

angular.module('integrationApp').factory('integrationFactory', integrationFactory);

Because the releasenotes is constantly being upgraded the only way I could save it as JSON was if it went something like,

{"0": "this is the first note", "1": "this is the second note", "2": "etc..." }

Because there's no key however, I can't exactly do,

<div ng-repeat key in notes>
    {{ key.notes }}
 </div>

Is there any other way to do it? Any help would be greatly appreciated.

1
  • <div ng-repeat ="(key,value) in notes"> {{ value}} </div> Commented Apr 22, 2014 at 6:47

2 Answers 2

1

Use $index! Just do:

<div ng-repeat key in notes>
    {{ key[$index] }}
</div>
Sign up to request clarification or add additional context in comments.

Comments

0

You could do something like this

<div ng-repeat ="(key,value) in notes"> {{ value}} </div>

Comments

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.