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 193 posts 469 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);
                   }
               };
           });
    
       }]);
    
Please Sign in or register to post replies

Write your reply to:

Draft