I am new to `angular`. I have the `post` list view and `post` edit view. my `list.html`. I want to edit the post on clicking the edit button but I am not having a clue on how to get the edit data. My current code looks like
`list.html`

```
 <table class="table table-striped table-bordered table-hover table-full-width" id="sample_1">
       <thead>
          <th>Title</th>
          <th>Description</th>
          <th>Author</th>
          <th>Action</th>
       </thead>
       <tbody>
          <tr ng-repeat="post in blog | orderBy:'created_at':true">
             <td>{{post.title}}</td>
             <td>{{post.description}}</td>
             <td>{{post.author}}</td>
             <td>
                <a href="#/blog/edit/{{post._id}}" class="btn btn-default btn-sm">Edit</a> &nbsp; 
                <a href="#/blog/delete/{{post._id}}" class="btn btn-default btn-sm">Delete</a>
             </td>
          </tr>
       </tbody>
    </table>

```

So, on clicking the `button`, I am navigating to my `edit.html` which looks like

```
<form role="form" class="form-horizontal" ng-submit="editPost()">
   <div class="form-group">
      <label class="col-sm-2 control-label" for="form-field-1">
      Title
      </label>
      <div class="col-sm-9">
         <input type="text" placeholder="Post title" id="form-field-1" class="form-control" ng-model="blog.title" value="{{blog.title}}">
      </div>
   </div>
   <div class="form-group">
      <label class="col-sm-2 control-label" for="form-field-2">
      Description
      </label>
      <div class="col-sm-9">
         <textarea placeholder="description" rows="5" id="form-field-2" class="form-control" ng-model="blog.description"></textarea>
      </div>
   </div>
   <div class="form-group">
      <label class="col-sm-2 control-label" for="form-field-1">
      Author
      </label>
      <div class="col-sm-9">
         <input type="text" placeholder="Author" id="form-field-1" class="form-control" ng-model="blog.author">
      </div>
   </div>
   <div class="form-group">
      <div class="col-sm-9 col-sm-offset-2">
         <button type="submit" class="btn btn-primary btn-sm">Update</button>
      </div>
   </div>
</form>

```

now I have make `restful` api using `nodejs` which I have tested using `postman` and its working fine. My `api` url are like

```
localhost:3000/api/posts/id 

```

What I want to achieve now is, I want to get the data from the `db` on clicking the edit button.
my current `js` declaration

```
var meanApp = angular.module('meanApp', ['ui.router', 'ngMessages', 'ngResource']);

meanApp.config(function($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise('/');
    $stateProvider
        .state('common', {
            abstract: true,
            views: {
                '': {
                    templateUrl: 'shared/common.html'
                },
                'header@common': {
                    templateUrl: 'shared/header.html'
                },
                'sidebar@common': {
                    templateUrl: 'shared/sidebar.html'
                },
                'script@common': {
                    templateUrl: 'shared/script-init.html'
                },
            },
        })

    .state('blogEdit', {
        url: '/blog/edit/{id}',
        parent: 'common',
        views: {
            '': {
                templateUrl: 'components/blog/edit.html'
            },
        },
        controller: 'postEditController'
    })

});

meanApp.controller('postEditController', function(postService, $stateParams, $scope, $http, $location) {
    //code to get the data from db using the id of the post

});

```

Any help will be appreciated.