Angularjs login page error.
<p>I have been getting this error and I couldn't find a solution yet. This is my console error. I tried googling for solutions but it shows the Object.parse error. I have not used any json.parse() function too. </p>

<pre><code>angular.js:11500 SyntaxError: Unexpected token }
at Object.parse (native)
at oc (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:14:136)
at Yb (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:76:271)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:77:117
at r (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:7:302)
at Vc (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:77:99)
at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:78:205)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:111:252
at k.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:125:120)
at k.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js:122:218)(anonymous function) @ angular.js:11500(anonymous function) @ angular.js:8479(anonymous function) @ angular.js:13083k.$eval @ angular.js:14291k.$digest @ angular.js:14107k.$apply @ angular.js:14395m @ angular.js:9569N @ angular.js:9756w.onload @ angular.js:9697
</code></pre>

<p>This is my controller.js file</p>

<pre><code>app.controller('logincontrol', function ($scope, $http, $location) {
$scope.loginData = null;
$http.get('/newshop/JSON/login.json')
  .success( function (data) {
    $scope.loginData = data;
  })

$scope.login = function( user ) {
for( var i = 0; i &lt; $scope.loginData.length; i++) {
    var temp = $scope.loginData[i];
    if(user.name === temp.username &amp;&amp; user.password === temp.password ){
        alert("Hurray!");
        break;
    } else {
      alert("Fails!");
    }
}
}});
</code></pre>

<p>This is my login.json file</p>

<pre><code>[
  {
"username ": "admin",
"password": "admin",
  },
  {
"username" : "haritha",
"password" : "haritha123",
  },
  {
"username" : "harry",
"password" : "harrypotter"
   }
]
</code></pre>

<p>This is my login.html file.</p>

<pre><code>  &lt;body ng-app= "loginapp"&gt;
  &lt;div class= "container" ng-controller="logincontrol"&gt;
    &lt;div class="icon-wrapper"&gt;&lt;i class="fa fa-user fa-5x custom-icon"&gt;&lt;/i&gt;&lt;/div&gt;
    &lt;form action="" id="login"&gt;
        &lt;div class="form-input"&gt;
          &lt;input type="text"  placeholder="Username" ng-model= "user.name" &gt;&lt;br&gt;
          &lt;input type="password"  placeholder="Password" ng-model= "user.password" &gt;&lt;br&gt;
          &lt;button  class="btn-login" type="button" ng-click= "submit(user)"&gt; Login &lt;/button&gt;
        &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;
</code></pre>

<p></p>