5

That is because you are not calling the REST api "/_api/web/lists/getByTitle('MyList')", the url you are calling returns the the ListView (AllItems.aspx) page. Change the url to _spPageContextInfo.webAbsoluteUrl + '/_api/web/lists/getByTitle("MyList")/items'


5

You should reference the SP.RequestExecutor.js before the angular.js reference. <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script> <script type="text/javascript" src="/_layouts/15/sp.js"></script> <script type="text/javascript" src="/_layouts/15/SP.RequestExecutor.js"></script> <script type="text/...


5

You could consider the following options Option 1. 1) modify the query to include additional information. Since Ratings properties belong to ListItem resource, append the following expression: $expand=ListItemAllFields to the endpoint url 2) once the data is returned perform the filtering by on the client side by Ratings field Example: var url = ...


4

Enjoyed reading the comments on this one (all good points, and I will add the level of abstraction it adds when you are trying to debug!) :-) Anyway, I believe this is what you are looking for*: //import { IWebPartContext } from '@microsoft/sp-client-preview'; // Old dcumentation refers to this. import { IWebPartContext} from '@microsoft/sp-webpart-base'; ...


4

If possible, I recommend you to upgrade your solution to the latest SPFx 1.6 version and get rid of adal.js in your code. Read here more about the release and how to upgrade your solution. Why I suggest moving to 1.6: adal.js inside SPFx has lots of caveats you should be aware of. You should implement everything by yourself, which might be error ...


3

I fought with this for a long time as well as I am very new to both SharePoint app development, AngularJS, and JavaScript.... In your ProductEditInfoView.html, change: <form class="form-horizontal" name="productForm"> to: <ng-form class="form-horizontal" name="productForm"> By doing this, ASP.NET will not see an embedded form tag, and ...


3

I've recently started playing with using gulp tasks to set up watches on my source files, so that when they change they are automatically uploaded to the SharePoint document library where they need to go. There are a couple of node/gulp libraries out there that do this. gulp-spsave which I used in my most recent project gulp-spsync which I'm going to look ...


3

I had the same experience when migrated our SP2013-based AngularJS solutions to SP2010. The problem was in our case a kind of timing issue. The solution was to introduce a 1-2 seconds of delay in the controller before calling the methods of our SharePoint service: setTimeout(function () { $scope.getContacts($scope, mySharePointService); }, 1000); ...


3

You can do it, using both JSOM and the Rest OData API, but you´ll have to validate the data on the client, Sharepoint will not handle it.


3

I would be careful about implementing Angular routes in Web Parts (no matter if it's Angular 1 or 2). Imagine that you would have multiple Web Parts on the page each with each own set of routes persisted through the URL. Changing the route in one Web Part would update the URL resetting all other Web Parts on the page. That could be perceived as confusing by ...


3

You can fetch value from description by using .text() function in the success of the function.. please refer below code myAngApp.controller('spCustomerController', function ($scope, $http) { $http({ method: 'GET', url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Questions')/items?$select=Description", ...


3

You are getting HTML content because you have enabled Enhanced rich text option in your column. Solution No#1 Enable Plain text instead of Enhanced rich text Solution No#2 Remove HTML tags using Regex var myAngApp = angular.module('SharePointAngApp', []); myAngApp.controller('spCustomerController', function($scope, $http) { $http({ ...


3

Currently ngOfficeUIFabric uses an older version of Office UI Fabric than the version used by the SharePoint Framework. If you'd load ngOfficeUIFabric and its CSS, you would break the existing SharePoint UX. Instead of using ngOfficeUIFabric in your SPFx solution built using AngularJS, you should either use the Office UI Fabric CSS styles available with ...


3

You could do it with these changes: Add the following attribute to the input field: ng-keypress="vm.myFunction($event)" Add the following function to your vm object: myFunction = function (keyEvent) { if (keyEvent.which === 13) { //enter pressed - here goes your code } } EDIT based on the comment: You could ...


3

Try using endpoint something like below: _spPageContextInfo.webAbsoluteUrl +"/_api/web/GetFolderByServerRelativeUrl('SitePages')/Files?$select=Name,Title,ServerRelativeUrl,ListItemAllFields&$expand=ListItemAllFields


2

Checkmark is a read-only field. Try changing PercentComplete to 100


2

You are trying to access a list in the Host Web from the App Web. To do this you need to do two things: Request permission to read the list in the app manifest Modify the url property of the request to use the cross-domain library The url should look something like this: var appUrl = GetUrlKeyValue("SPAppWebUrl"); var hostUrl = GetUrlKeyValue("...


2

I had the same problem (Angular App in SP, which was not working with IE9, but all other browser). Delete the ng-app="testLabApp" from the html tag and insert a separate div (after body) with ng-app. That was working for me with IE9 in SP.


2

It looks like the query is working as it should. Your selector looks off. Try Item.AssignedTo.results.FirstName


2

For uploading file, AngularJs does not work in jQuery way! In earlier time, I had a R&D and made it working. Find below: function fileUploadRequest(data, url) { var deferred = $q.defer(); $http({ url: baseUrl + url, method: "POST", processData: false, data: data, ...


2

FYI, toggles are much easier with Booleans <div ng-init="value = true" ng-click="value = !value">On/Off</div> <h1 ng-show="value" >Foobar1</h1> <h1 ng-show="!value" >Foobar2</h1>


2

I can't tell you what part of SP decides when you should browse by navigating between pages, or when the start.aspx is used, but once start.aspx is used it uses the hash to store the location of where you are, in case you copy it and link a colleague. You can find some information in this blog post: http://www.hezser.de/blog/2012/08/18/what-is-the-...


2

SharePoint people or group column requires user's or group's Id to save into it. You can get current user's Id from _spPageContextInfo var userId = _spPageContextInfo.userId; Now let's say your people or group column name is Vendor. So in the request body it should look like: var data = { VendorId: userId }; More details is here.


2

This happens because of Angular forces HashBang mode by default and it listens for URL changes then override the hash(#) queries which append by SharePoint refiner. You can avoid this by enabling HTML5Mode but its not a permanent solution.More details on angular location provider $locationProvider.html5Mode(true).hashPrefix('*'); Permanent solution would ...


2

As it turns out the simplest solution ever was to use simply forgo any of the change token code and do this instead... var posts = /*All the queries that will update your list*/ $q.all(posts).then(function(x) { requeryData(); }); Thank you @John-M for making me go back and skim through the code that was generating my POSTs. The reason it wasn't working ...


2

By renaming it to .html, SharePoint doesn't know how to parse the <% %> tags (which are ASP.NET). They are rendered on the server before being sent to the client. The errors you see in the browser simply mean they don't understand the server-based tags. If you remove the first two comment lines <% ... %>, the page should no longer display those ...


2

Lookup column information can be retrieved using $expand operator. For example: List A has column Title, Name and List B has column Title, Name and Lookup column named LookupA (Lookup list is A). So if you are querying in B list, then your query should look like /_api/web/lists/getbytitle('B')/items?$select=Title,Name,LookupA/Title,LookupA/Name&$expand=...


2

After some digging, I have found a solution to the problem I though would be useful to share here (I didn't found any blog post or such tackling this problem, but I guess it is something someone else may need one day). First step is avoiding the need for a form TAG. Looking at the documentation I found out some reference stating that X-Editable supports the ...


2

You can get the global navigation in angular like below: var myAngApp = angular.module('SharePointAngApp', []); myAngApp.controller('spController', function ($scope, $http) { $http({ method: 'GET', url: _spPageContextInfo.webAbsoluteUrl + "/_api/navigation/menustate?mapprovidername='GlobalNavigationSwitchableProvider'", ...


2

Unfortunately there is no API to overwrite the list attachment, so you need to delete the attachment first before uploading it. Try the below sample code: function checkFileExists(){ $.ajax({ url: "https://sitecollectionurl/_api/web/getFileByServerRelativeUrl('/sitecollectionurl/Lists/Test/Attachments/1/test.txt')", method: "GET"...


Only top voted, non community-wiki answers of a minimum length are eligible