I have created a very basic controller to pull data from a SharePoint list, but it only pulls the base Title and created column. It doesn't pull any columns I have created, which are the ones I require. Is there a setting in SP itself to state it is available for the API?
- <div ng-app="listApp">
- <div id="App1" ng-controller="controller1">
- <h1>First List Items</h1>
- <div ng-repeat="item in items">
- <p>{{item.Title}}</p>
- </div>
- </div>
- </div>
- var appVar = angular.module('listApp', []);
-
- appVar.controller("controller1", function($scope){
- GetListItems($scope, "List1");
- });
-
- function GetListItems($scope, listName){
- $.ajax({
- url: "https://example.com/sites/mysite/_api/web/lists/GetByTitle('"+listName+"')/items",
- method: "GET",
- async: false,
- headers: { "Accept": "application/json;odata=verbose" },
- success: function(data){
- $scope.items = data.d.results;
- },
- error: function(sender,args){
- console.log(args.get_message());
- }
- });
- }