I have used the "sp.js" to access the sharepoint ClientContext in SharePoint 2010 and 2013 webparts. I want to use the SP ClientContext in my office 365 add-in.
The code i have used,
ExecuteOrDelayUntilScriptLoaded(function () {
var context = new SP.ClientContext.get_current();
}, "sp.js");
It failed to load the "sp.js" file when i tried it in office 365 SharePoint add-in. How to resolve this issue? What is the way to use "sp.js" file in office 365 SharePoint add-in?
EDIT: I am creating the SharePoint hosted add-in.
EDIT:2 I have created a new SharePoint add-in project in VisualStudio 2015, and it has the html code. So, i am unable to use below code in my page,
<SharePoint:ScriptLink ID="ScriptLink1" name="SP.js" runat="server"
ondemand="false" localizable="false" loadafterui="true" />