在线在Sharepoint上部署Angular2项目 [英] Deploying Angular2 project on Sharepoint online

查看:144
本文介绍了在线在Sharepoint上部署Angular2项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地环境中创建了一个示例Angular2项目(rc-4),该项目运行良好.

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

现在,我必须将其作为子网站托管在SharePoint Online上.不幸的是,我不知道该怎么做以及要搜索哪些关键字?

Now I have to host this on SharePoint Online as a subsite. Unfortunately I have no clue on how to do it and what keywords to search for ?

我在Pages文件夹中创建了一个索引页,并作为Web部件向其中添加了index.html

I created a index page in Pages folder and added index.html to it as Web part

它给我一个错误:系统未定义(因为node_modules文件夹不存在)

It gives me the error: System is undefined (because node_modules folder does not exist)

我试图在远程位置运行npm install

I tried to run npm install on the remote location

(首先必须编辑注册表以允许在远程位置使用cmd) 虽然命令给了我很多untar.error

(First Had to edit registry to allow cmd on remote locations) Though the command give me lots of untar.error

接下来,我尝试从本地环境中复制文件夹.到自1天以来一直运行但仍未完成的远程位置

Next i tried to copy the folder from my local env. to remote location which is running since 1 day and still not complete

我还同步了Site Assets文件夹到本地系统,将node_modules文件夹复制到了该位置,并让OneDrive for Business进行了同步,但无济于事.

I also synced Site Assets folder to my local system, copied node_modules folder into the location and let OneDrive for Business do the sync but to no avail.

有什么建议吗?

推荐答案

我意识到这篇文章很旧,但是我想我可以帮助其他一些尝试做一些自定义页面工作的SharePoint开发人员!

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!

这是我的工作:

  • run ng build//为您的Angular项目构建发行版
  • 在SharePoint上创建一个文档文件夹来托管您的Angular文件
  • 使用正确的css和js文件的URL编辑发行版index.html文件
    • > https://[您的通常是域名] .sharepoint.com/[站点名称]/[带发行版的文件夹文件]/
    • 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]/

      顺便说一句,这适用于其他框架,例如jquery和bootstrap.

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

      这篇关于在线在Sharepoint上部署Angular2项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆