using angularjs to read json file, but its not happening

This is not working for reading and inserting data, I have data.json in js folder

  <div ng-controller="jsonCtrl" ng-repeat="d in data">

      <h2>Total Data {{ getTotalData() }}</h2>

      <input type="text" ng-model="Name">

      <label>Short name</label>
      <input type="text" ng-model="Shortname">

      <input type="text" ng-model="Reknown">

      <input type="text" ng-model="Bio">

      <button ng-click="addData()">Add</button>


angular.module('starter', ['ionic'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default 
    // (remove this to show the accessory bar above the keyboard for form inputs)
    if (window.cordova && window.cordova.plugins.Keyboard) {
    if (window.StatusBar) {

My controller looks like this:

.controller('jsonCtrl', function($scope, $http) {

  $http.get('data.json').success(function(res) {
    $ = res;

  $scope.addData = function() {
      name: $scope.Name,
      shortname: $scope.Shortname,
      reknown: $scope.Reknown,
      bio: $scope.Bio

  $scope.getTotalData = function() {
    return $;

Source: json

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.