javascript - Uncaught TypeError: Cannot read property 'loadDataToGrid' of undefined -


I have a code that uses data to load data passing through an external logging in jQGrid I'm using an AngularJS factory method to get started and retrieve the Jason document I received. I'm getting Uncort type error: The properties of 'undefined' error code in Chrome console can not be read 'loadDataToGrid'

JQuery Function for loading data in jQGrid: - < /p>

  $ (function ($ radius, $ http, $ rootScope, retriveDataFromServer) {$ ("# list"). JqGrid ({url: retriveDataFromServer.loadDataToGrid ($ http), datatype: "Jason Columns: [{name: "fname", width: 55}, {name: "lname"}, "name": "GET", colNames: ["employee first name", "employee last name", "contact no"], , Width: 60}, {name: "contact no", width: 55, align: "right"},], pager: "#pager" punk "Employee data grid": 10, autowthth: true, rowList: [10, 20, 30], sort name: "fname", sortorder: "desc", viewrecords: true, gridview: true, autoencode: true, caption: });});  

AngulaJS factory method: -

empApp.factory ('retriveDataFromServer', function) {return {loadDataToGrid: function ($ http) {return $ Http ({Method: 'GET', url: 'http: // localhost: 8080 / IdeaOne / viewall'}). Then (function (feedback) {return response;})}}});

html: -

  & lt; Div ng-app = "empApp" & gt; & Lt; Table id = "list" & gt; & Lt; Tr & gt; & Lt; TD & gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; / Table & gt; & Lt; Div id = "pager" & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

When it directly loads your data by specifying your URL inside the jQuery method then it works fine.

Someone please tell me where I went wrong.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -