Here I'm actually trying to get json data and display them on a jade template with the use of an angular controller.

**Controller :** **processJson.js**

```
 var getJson = angular.module('getJson', []).controller('controller1',   function ($scope, $http) {
var url = '/fields/fieldlist';
console.log(url);
$http.get(url).success(function (data) {
    $scope.posts = data;
  });

 });

```

This doesn't parse json array to jade template

**fields.js** 

```
var express=require('express');
var router =express.Router();

 router.get('/fieldlist',function(req,res){
  var db=req.db;
  var collection=db.get('domlist');
   collection.find({},{},function(e,docs){
    res.json(docs); 
  });  
});

module.exports=router;

```

This successfully returns a json array object.

Here's my jade template 

```
html
head

body 
     div(ng-app='getJson')
        div(ng-controller='controller1')
            div(ng-repeat='post in posts')
                div(ng-switch-when='text')

                    input(type='text' id='{{post.id}}' ng-model='post.value' placeholder='{{post.placeholder}}')

                    block content

```