Skip to main content


Showing posts from October, 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" > 

Get Web Part Title and Add Link / Text / Image to the right side of the web part title

Here is the code to get web part title and then add image or text or link in web part title and right align that.

You have to put this code in Script editor web part or put this code in a file & store somewhere & provide link to master page or provide link to content editor web part

// Function to add link/text/icon in right side of the web part title

 $(document).ready(function () {

    var className='.ms-webpart-titleText';

    $(".ms-webpart-chrome-title span h2").each(function(inx){       
        var webPartTitle = $(this).text();

        //Check web part title
        if(webPartTitle.indexOf("My Web Part Title")>=0)
            var openUrl ="javascript:OpenPopUpPageWithTitle(\""+_spPageContextInfo.siteServerRelativeUrl+"/Style Library/MyFolder/MyPage.aspx?IsDlg=1\", RefreshPage, null, null, \"My Page Title\"); return false;";

            $(this).prepend("<div class='small' title='…