title: Unable to send Crypto JS encrypted data via ajax call
body: <p>I am trying to encrypt a password and store it on Mongo LAB via Ajax call post.
  I am getting the following error : 
  I searched for the error but not getting what it means that it is pointing circularly.
  Error:</p>
  
  <pre><code>TypeError: Converting circular structure to JSON
      at Object.stringify (native)
      at n.$scope.signup (file:///C:/Users/naval.joshi/Desktop/eWallet/Assignment/Assignment/register.js:26:32)
      at fn (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:212:409), &lt;anonymous&gt;:4:209)
      at f (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:253:485)
      at n.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:133:221)
      at n.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:133:451)
      at HTMLButtonElement.&lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:254:36)
      at HTMLButtonElement.Hf.c (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:35:217)
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>var reg = angular.module('register', ['ngRoute']);
  reg.controller('regCntrl', function($scope,$http) {
       $scope.signup = function() {
  
          $scope.encryptedData = CryptoJS.AES.encrypt($scope.password, "123"); 
          alert($scope.encryptedData);
  
          //alert("naval");
  
                        var inventory = {
                          name: $scope.name ,
                          email: $scope.email,
                          password: $scope.encryptedData,
                          phoneno:$scope.phoneno
                            };
              $.ajax({
                  url: "https://api.mongolab.com/api/1/databases/geolocation/collections/boom?apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                  type: "POST",
                  data: JSON.stringify( inventory ),
                  contentType: "application/json; charset=utf-8"
              }).done(function( msg ) {
                  console.log(msg);
              });
   };
      // populate the code to fill mongo DB
  });
  </code></pre>