docs/app/js/anchor.js
function createContentURL() {
        var path = '';
        var name = element.text();
        // Use $window.location.pathname to get the path with the baseURL included.
        // $location.path() does not include the baseURL. This is important to support how the docs
        // are deployed with baseURLs like /latest, /HEAD, /1.1.13, etc.
        if (scope.$root.$window && scope.$root.$window.location) {
          path = scope.$root.$window.location.pathname;
        }
        name = name
          .trim()                           // Trim text due to browsers extra whitespace.
          .replace(/'/g, '')                // Transform apostrophes words to a single one.
          .replace(unsafeCharRegex, '-')    // Replace unsafe chars with a dash symbol.
          .replace(/-{2,}/g, '-')           // Remove repeating dash symbols.
          .replace(/^-|-$/g, '')            // Remove preceding or ending dashes.
          .toLowerCase();                   // Link should be lower-case for accessible URL.
        scope.name = name;
        scope.href = path + '#' + name;
      }
function createContentURL() {
        var path = '';
        var name = element.text();
        // Use $window.location.pathname to get the path with the baseURL included.
        // $location.path() does not include the baseURL. This is important to support how the docs
        // are deployed with baseURLs like /latest, /HEAD, /1.1.13, etc.
        if (scope.$root.$window && scope.$root.$window.location) {
          path = scope.$root.$window.location.pathname;
        }
        name = name
          .trim()                           // Trim text due to browsers extra whitespace.
          .replace(/'/g, '')                // Transform apostrophes words to a single one.
          .replace(unsafeCharRegex, '-')    // Replace unsafe chars with a dash symbol.
          .replace(/-{2,}/g, '-')           // Remove repeating dash symbols.
          .replace(/^-|-$/g, '')            // Remove preceding or ending dashes.
          .toLowerCase();                   // Link should be lower-case for accessible URL.
        scope.name = name;
        scope.href = path + '#' + name;
      }
function createContentURL ( ) { var path = '' ; var name = element . text ( ) ; // Use $window.location.pathname to get the path with the baseURL included. // $location.path() does not include the baseURL. This is important to support how the docs // are deployed with baseURLs like /latest, /HEAD, /1.1.13, etc. if ( scope . $root . $window && scope . $root . $window . location ) { path = scope . $root . $window . location . pathname ; } name = name . trim ( ) // Trim text due to browsers extra whitespace. . replace ( / ' / g , '' ) // Transform apostrophes words to a single one. . replace ( unsafeCharRegex , '-' ) // Replace unsafe chars with a dash symbol. . replace ( / -{2,} / g , '-' ) // Remove repeating dash symbols. . replace ( / ^-|-$ / g , '' ) // Remove preceding or ending dashes. . toLowerCase ( ) ; // Link should be lower-case for accessible URL. scope . name = name ; scope . href = path + '#' + name ; }
Creates URL from the text content of the element and writes it into the scope.
Creates URL from the text content of the element and writes it into the scope .