在Sharepoint中使用JS/Angular js进行开发而无需访问Sharepoint Designer [英] Development using JS/Angular js in Sharepoint without access to Sharepoint Designer

查看:81
本文介绍了在Sharepoint中使用JS/Angular js进行开发而无需访问Sharepoint Designer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在这里面临一些挑战.我正在尝试使用SharePoint在angular js中创建动态javascript表单,但是很遗憾,由于它是公司的Intranet版本,因此无法访问SharePoint Designer,并且他们不允许这样做. 这意味着我显然无法在Visual Studio中构建SharePoint App并将其连接到网站的开发人员"页面(我们在网站上没有该应用程序).

I have a little bit of a challenge here.  I am attempting to create a dynamic javascript form in angular js with SharePoint but unfortunately do not have access to SharePoint Designer due to it being a company intranet version and they don't allow that.  Which means I am not able to build a SharePoint App in Visual Studio apparently and connect it to the Developer page of the site(we don't have that on the site).

基本上,我想要创建一个外观漂亮的自定义表单(该表单的默认版本比ugly丑陋),并绑定到一个SP  List(实际上是多个列表,具体取决于我需要的列表)查找对主列表的操作) 允许用户输入/更新/编辑各种内容.

Basically what I want is to create a nice looking custom form(the default version of the form is just uglier than ugly) which ties into a SP List(actually multiple lists based on what I will need to do with lookups to the main list) that allows users to enter/update/edit various things.

我曾尝试将文件上传为站点资产,然后使用内容Web部件,但这会引发错误,因为HTML上有一个表单,它说我不能使用它-我试图嵌入网页上带有  javascript的HTML,但无论如何 我该怎么做,相同的错误不断弹出,即"[$ Injector:error!]"模块"MainPage"找不到或丢失!"表示在尝试将其他内容加载到脚本之前,它不会加载包含这些脚本的脚本 HTML页面.

I have tried uploading the files as site assets and then using a content Web Part but that throws an error because there is a form on my HTML and it says I can't use that---I have tried to embed the HTML with  javascript on the page itself but no matter how I do it, the same error keeps popping up which is "[$Injector:error!]  Module "MainPage" is not found or is missing!" meaning it is not loading the scripts containing those before it tries to load the rest of the content on the HTML page. 

我知道必须有解决方案,但是我不知道这是什么,因为这是我第一次使用SharePoint进行开发.有人可以向我指出正确的方向,以确保如何确保在尝试加载所有脚本之前 运行HTML代码的正文?

I know there has got to be a solution to this but I don't know what it is as this is my first time using SharePoint for development purposes.  Can somebody point me in the right direction as to how to ensure all my scripts load before it attempts to run the body of the HTML code?

推荐答案

如果您不能使用SharePoint Designer或Visual Studio,我们还可以将带有JavaScript代码的HTML嵌入到内容编辑器Web部件或脚本编辑器Web部件中.

If you can't use the SharePoint designer or visual studio, we can also embed your HTML with JavaScript code in a Content Editor Web Part or Script Editor Web Part to achieve it.

以下示例供您参考:

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<div ng-app="" ng-controller="controller">
	<!--ng-model binds the input field to the controller property firstName-->
	First Name: <input type="text" ng-model="user.firstName"><br>
	<!--ng-model binds the input field to the controller property lastName-->
	Last Name: <input type="text" ng-model="user.lastName"><br>
	<br>
	<!--{{}} AngularJS expression-->
	Welcome {{fullName()}}
</div>

<script>
function controller(


范围){ //


scope.user是控制器对象的属性 //firstName& lastName是用户对象的属性
scope.user is the property for controller object // firstName & lastName are the properties for user object


这篇关于在Sharepoint中使用JS/Angular js进行开发而无需访问Sharepoint Designer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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