Error:input is undefined Angular when Ajax request to get data from php -


i trying make ajax request php angular js. not getting data have sent php file.

i'm getting error:

error:input undefined

my source:

file app.js:

 (function () { var app = angular.module('myapp', ['ngroute']);  app.config(function ($routeprovider) {     $routeprovider              .when('/', {                 controller: 'contentsctrl',                 templateurl: 'views/contents.php'             })              .when('/jalse/:jalseid', {                 controller: 'recordsctrl',                 templateurl: 'views/jalse.php'             })              .otherwise({redirectto: '/'}); });  }()); 

file view.html:

<div class="content-panel"> <div class="content-panel-title">     <a href="#/records/" class="left"></a>     <h2>  {{jalse.contentdate }}</h2> </div>  <div ng-repeat="jalse in records">     {{jalse.contentdate }} </div> 

file jalsefactory.js:

    (function () {  'use strict';  var jaslefactory = function ($http, $q) {  var factory = {};  factory.getjalse = function () {     var deferred = $q.defer();      $http({method: 'get', url: 'includes/records.php'}).             success(function (data, status, headers, config) {                 deferred.resolve(data);             }).             error(function (data, status, headers, config) {                 deferred.reject(data);             });     return deferred.promise;   }; return factory; };  jaslefactory.$inject = ['$http', '$q']; angular.module('myapp').factory('jaslefactory', jaslefactory);  }()); 

file recordsctrl.js:

(function () { 'use strict';  var recordsctrl = function ($scope, $http, $routeparams) {     var jalseid = $routeparams.jalseid;      $scope.records = jaslefactory.getjalse();      $scope.jalse = null;      function init() {         (var = 0, len = $scope.records.length; < len; i++) {             if ($scope.records[i].contentid == parseint(jalseid)) {                 $scope.jalse = $scope.records[i];                 break;             }         }     }      init();  };  }()); 


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -