To create apps using Visual Studio 2015 Community, you need to make sure create sharepoint teamsite as developer site. We should make apps on developer site, then it need to deploy to app store. If you use not developer site but teamsite, on debugging , you can meet error as “Error occurred in deployment step “Install SharePoint-Add in’ : Sideloading of apps is not enabled on this site.”
Create new project on visual studio 2015 communtiy
- Open Visual Studio 2015 community as administrator
- You need to input “What SharePoint site do you want to use for debugging your add-in?” to sharepoint developer site, and also select “SharePoint-hosted”
- You need to select “SharePoint Online” on the Specify the target SharePoint version
See around project which you created.
You can see Default.aspx page , it have SharePoint Script as “sp.js” , jquery and app.js.
Let me explain those components.
SP.ClientContext object (sp.js) : Represents the context for objects and operations.ClientContext constructor initializes a new instance of the ClientContext object for the specified SharePoint site.
Let’s do it as easy example.
Create button on Default.aspx as Html Tag
Move to App.js then remove all scripts except ‘use strict’ on top of this script.
After you save all changes then you need to “Execute” Button on Visual Studio, you can see deployed apps on this sharepoint like below.
This post which I recently uploaded to this blog to study online sharepoint as client object model. Since now I’ll create and concentrate on online sharepoint development