title: Getting and displaying JSON data fields using HTML and AngularJS
body: <p>Im new to angularJS and web designing as a whole. Im trying to get a data field(or element) from a JSON. For example, this is what the JSON looks like</p>
  
  <pre><code>{
    "Name":"Raymond Eugene Monce",
    "Dateofbirth":"1924-0308T00:00:00Z",
    "Ethnicity":"Caucasian",
    "Languages":["{English}"],
   },
  </code></pre>
  
  <p>and I'm trying to get the "Name" data field. This is what my .js file looks like, </p>
  
  <pre><code>var profile = angular.module('profile', ['ui.bootstrap','ngResource']);
  
  profile.controller("profileController", ["$scope","$resource", function($scope, $resource) {
  
      // get the user id
      $scope.userid = sessionStorage["cerestiuserid"];
  
      // json we get from server
      $scope.apicall = sessionStorage["cerestihome"];     // NEED TO CHANGE API
  
      // grabs the user we want
      $scope.userResource = $resource($scope.apicall + "/api/userprofile/", 
        {Userid:21},  
        {'get':{method: 'POST'}}
      );
  
      // fetch JSON           
      $scope.userResource.get(function(result) {
        // get the name field
        $scope.name = result;
        sessionStorage["name"] = JSON.stringify(result);
      });
  </code></pre>
  
  <p>and my .html file, </p>
  
  <pre><code>&lt;div ng-controller = "profileController" style="float:left"&gt;
    &lt;!-- profile pic --&gt;
    &lt;div class="pull-left"&gt;
      &lt;div class="container-fluid"&gt;
        &lt;div class="profile"&gt;
          &lt;div class="row"&gt;
            &lt;div class="center-block"&gt;
              &lt;div class="profilePic"&gt;
                &lt;img ng-src="{{profilePic()}}" class="img-responsive"&gt;
                  &lt;!-- name field --&gt;
                  &lt;label class="caption"&gt;
                    &lt;h4&gt;{{name.name}}&lt;/h4&gt;
                  &lt;/label&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Again, Im not having problems with the Database or API calls. I just want to know how I can get and display the name field of the JSON. Thanks.</p>