Adding Comment feature to a JSON data using AngularJS


Staff member
I took an AngularJS test yesterday and I was provided two task.

<li>I need to display the data of a JSON file on the web page in HTML form.

<li>So I took the FreshlyPressed JSON through the link "<a href="" rel="nofollow"></a>" and was able to display the thumbnail, post title, content and so on . . on the web page.</li>
<li>User must be able to post comments on each post.</li>

This is where I got stuck since I am not sure if it is possible. Is it possible to add a comment feature to an external JSON data such as the one I used? I just want to know the possibilities and the limitation of the external JSON file. Thank you.

This is my js file

var myapp = angular.module('myapp', ['ui.bootstrap']);

myapp.controller('mainCtrl', function($scope, $http) {


    .success(function(response) {
        $scope.names = response.posts;

    .filter('to_trusted', ['$sce', function($sce){
        return function(text) {
            return $sce.trustAsHtml(text);

This is my HTML

&lt;body data-ng-controller="mainCtrl" data-ng-app="myapp"&gt;

&lt;div data-ng-repeat="p in names" class="container"&gt;
&lt;img data-ng-src="{{ }}"&gt;&lt;br/&gt;
Author: {{ }}&lt;br/&gt;
URL: &lt;a href="{{ }}"&gt;{{ }}&lt;/a&gt;&lt;br/&gt;
Title: {{ p.title }}&lt;br/&gt;
&lt;div data-ng-bind-html="p.content | to_trusted"&gt;&lt;/div&gt;&lt;br/&gt;
Comments: {{ p.comments_open }}