Showing posts with label Sites. Show all posts
Showing posts with label Sites. Show all posts

Saturday, October 24, 2015

Get all sites with REST API and AngularJS

<script src=""></script> 
<script src=""></script> 
        var myAngApp = angular.module('SPAngGetWeb', []); 
        myAngApp.controller('SPAngGetWebController', function ($scope, $http) { 
                method: 'GET', 
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/webs?$orderby=Title", 
                headers: { "Accept": "application/json;odata=verbose" } 
            }).success(function (data, status, headers, config) { 
                $scope.customers = data.d.results; 
            }).error(function (data, status, headers, config) { 

<div ng-app="SPAngGetWeb"> 
    <div ng-controller="SPAngGetWebController" > 
        <table style="width: 100%;"> 
                <th style="">Id</th> 
                <th style="">Title</th>
                <th style="">Created</th>
                <th style="">ServerRelativeUrl</th> 
                <th style="">Url</th>
                <th style="">WebTemplate</th> 
            <tr ng-repeat="customer in customers"> 
                <td >{{customer.Id}}</td> 
                <td>{{customer.Created |date:'M/d/yyyy HH:mm'}}</td> 

SharePoint Framework client-side web part sample with Angular Elements

Greeting Web Part This web part is created with Angular Element. It has one element “ issharepoint ” which takes true if user is...