Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thomas Beckert 176 posts 441 karma points
    Aug 02, 2016 @ 13:22
    Thomas Beckert
    0

    $httpProvider Interceptor for certain DocumentTypes

    Hi guys,

    how can I depend the redirect to a certain doctype.

    Example:

    angular.module('umbraco.services').config([
       '$httpProvider',
       function ($httpProvider) {
    
               $httpProvider.interceptors.push(function ($q) {
               return {
                   'request': function (request) { 
       if(ONLY CERTAIN DOCTYPE) <- here I don't know how to determine the doctype
        {
          if (request.url.toLowerCase().indexOf('footer-content-right') !== -1) {
                                if (location.href.indexOf('content') !== -1) {
                                    request.url = '/App_Plugins/tweaks/views/newsletterButtons.html';
                                }
                            }
        }
      return request || $q.when(request);
                   }
               };
           });
    
       }]);
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies