This is a migrated thread and some comments may be shown as answers.

ListView with Angular not loading data

2 Answers 132 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 29 Nov 2016, 02:54 PM

Hi,

I'm trying to create a simple ListView using Angular but I can't get the ListView to show any data. What am I doing wrong?

http://dojo.telerik.com/@daxriders/IGeSA

Thank you.

Christian

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 01 Dec 2016, 08:19 AM
Hello Christian,

There are a few issues in the provided code:
  • The app should be specified as ng-app:
    <div np-app="app">
  • The refresh call and definition should be defined outside of the dataSource options. Also note that calling read initially will cause duplicate requests. You should either remove the initial refresh call or set the autoBind option to false to avoid this.
  • The dataSource should be defined before the listOptions. Otherwise $scope.dataSource will be undefined.
I updated the example with the suggested changes.

Regards,
Daniel
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Christian
Top achievements
Rank 1
answered on 02 Dec 2016, 08:02 AM
Thank you, Daniel!
Tags
ListView
Asked by
Christian
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Christian
Top achievements
Rank 1
Share this question
or