[英]Sitecore data into HTML through REST calls
How to expose Sitecore field data into HTML page using Javascript, AngularJS and RESTful web service calls? 如何使用Javascript,AngularJS和RESTful Web服务调用将Sitecore字段数据公开到HTML页面?
<!doctype html>
<html ng-app>
<head>
<title>List of Sales Engineers</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"></script>
<script src="../js/myangular.js"></script>
</head>
<body>
<div ng-controller="CallWebApi">
<ul>
<li ng:repeat="item in data.result.items">{{item.DisplayName}}</li>
</ul>
</div>
</body>
</html>
javascript to make the call and return the Sitecore items: javascript来拨打电话并返回Sitecore项目:
function CallWebApi($scope, $http) {
$http.get('**Sitecore URL**').
success(function (data) {
$scope.data = data;
console.log('success ' + data)
})
.error(function(data) {
console.log('failure ' + data)
});
What Sitecore URL do i have to pick to make a call? 我必须选择哪个Sitecore URL才能拨打电话?
For this kind of functionality you can use : 对于这种功能,您可以使用:
For Sitecore 7.2 or older release you can use Sitecore Web API . 对于Sitecore 7.2或更早版本,您可以使用Sitecore Web API。 In Sitecore 7.2 it was integrated with the release and before it was a standalone module.
在Sitecore 7.2中,它与该版本集成,之后它是一个独立的模块。
For Sitecore 7.5 or new versions you can use Sitecore Services Client. 对于Sitecore 7.5或新版本,您可以使用Sitecore Services Client。
https://sitecorecontextitem.wordpress.com/2015/01/07/what-is-sitecore-services-client/ https://sitecorecontextitem.wordpress.com/2015/01/07/what-is-sitecore-services-client/
Please read Sitecore Developer Guide 请阅读Sitecore开发人员指南
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.