3

All

I need to develop a simple application in Angular2 which will run on SharePoint Online.

I have gone through all the articles relevant to be able to make a decision.

My Options are either, I will use SharePoint Add-in and configure it to use Angular2 in, or Create a page layout and reference my Angular2 app there.

My question is that if I use second option which is using angular in a page layout, how will I use sharepoint js library to do my development environment?

I want to do development without deploying it to SharePoint online to test. Once I am done with development, that is the point I would like to made deployment.

Could you point me to right direction please? thanks

5
  • Are you aware of the modern SPFx stuff? See github.com/SharePoint/sp-dev-docs Commented Dec 6, 2016 at 10:15
  • @Danny'365CSI'Engelman No, not really. I have not developed Apps before for SP online. It looks like not suggested to be used in Prod environment as it is still in preview. is this my only option? Commented Dec 6, 2016 at 10:21
  • No, you can go 'oldskool' with your two mentioned options, but Microsoft is churning out SPFx fast, latest Drop 6 is already available to first-release tenants, all Modern Experiences are built with it, so expect SPFx to be "In Production" within months Commented Dec 6, 2016 at 10:26
  • @Danny'365CSI'Engelman What if I develop it on premise(as it will be a simple app) and deploy it to site assets in the site collection in SP online? My problem is rapid development. Deploying to SP online is hell everytime,, Commented Dec 6, 2016 at 10:31
  • 2
    That's up to you how you seperate the MVC pattern. I develop with mock List data generated with json-generator.com Only touch SharePoint when I really need to interact with SharePoint, and those interactions are abstracted in our own 'Framework' as well.. so developing FOR SharePoint is 90% NOT using SharePoint. SPFx also has such a 'offline workbench' approach, but with SPFx you still develop SharePoint webParts... Our workbench helps us develop WebComponents; they run in WordPress or any headless CMS as well. Commented Dec 6, 2016 at 10:45

1 Answer 1

1

I use angular-cli tool to develop angular (Angular 2, or Angular 4). It generates really convenient and organized structure just by a single command

ng new [app name] 

As far as sharepoint I dedicate one directory inside documents for Angular App.

When I'm ready to deploy, in console i generated build

ng build --prod 

Then it outputs everything to your [directory]/dist about 5 files, everything inside one of those file, the index.html are referenced. The only thing I had to change was the path to these references, because relative doesn't work.

So, inside the html.index, instead of src="./[filename]" I changed it to src="[sharepoint link to file when you click on it]"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.