Deploying Angular2 project on Sharepoint online

前端 未结 1 1419
我寻月下人不归
我寻月下人不归 2021-01-22 03:42

I have a sample Angular2 Project (rc-4) created on my local environment which works fine.

Now I have to host this on SharePoint Online as a subsite. Unfortunately I have

1条回答
  •  清酒与你
    2021-01-22 04:13

    I realize this post is old but I thought I would help some other new SharePoint developers who are trying to do some custom page work!

    Here is what I do:

    • run ng build // build a distro for your Angular project
    • create a document folder on SharePoint to host your Angular files
    • edit distro index.html file with the correct URL for the css and js files
      • https://[your domain name usually].sharepoint.com/[site name]/[folder with distro files]/
    • upload all of the distro files to SharePoint
    • create a new WEBPART page
    • edit WEBPART page and add a new Content Editor webpart
    • edit the new Content Editor and in the Content Link enter the URL to your new html file (index.html)

    Incidentally this works for other frameworks to like jquery and bootstrap.

    0 讨论(0)
提交回复
热议问题