Every time my webpage attempts to access the css file from a directive, I encounter a net::ERR_EMPTY_RESPONSE
.
I have implemented door3's on-demand css feature, which allows for lazy loading of css files only when necessary. This feature works flawlessly in my route file, but in my directive file, Chrome returns the net::ERR_EMPTY_RESPONSE
.
Check out the documentation for door3 here:
Despite disabling my ad blocker as suggested by some sources, the issue persists. I've scoured StackOverflow and Google for similar cases without luck. The css file name and path are correct upon double and triple checking. What could possibly be causing this error?
Below is my app.js configuration for door3's css on-demand:
angular.module('task2', ['ngRoute', 'ngResource', 'door3.css'])
.config(function($cssProvider) {
angular.extend($cssProvider.defaults, {
persist: true,
preload: true,
bustCache: true
});
});
Here is the directive "section1.js" where the error occurs:
angular.module('task2')
.directive('section1', function() {
return {
restrict: 'E',
templateUrl: 'partials/home/section1.html',
controller: function() {
this.getLogo = function() {
return logoImage;
};
this.brandName = "Geek Label";
this.section1Desc = "A team of self confessed geeks who are all about great digital design";
},
controllerAs: 'section1Ctrl',
css: 'css/partials/home/section1.css'
};
});
var logoImage = {
name: 'eyeglasses logo',
url: 'content/images/eyeglassesLogo.png'
};
Here is the content of the css file "section1.css":
#section1Row {
width: 100%;
}
#section1 {
height: 100vh;/*100% of viewport height*/
background-color: #D9435E;
position: relative;
}
Additionally, the routes file "routes.js" contains a working css file association:
//Routes
angular.module('task2')
.config(function($routeProvider) {
$routeProvider.
when('/home', {
templateUrl: 'partials/home/home.html',
name: "Home",
controller: 'HomeController',
controllerAs: "homeCtrl",
css: 'css/partials/home/home.css'
}).
otherwise({
redirectTo: '/home'
});
});
The specific error message displayed in Chrome reads:
GET http://localhost:8383/CompucorpTask2/n?cache=1456723626330 net::ERR_EMPTY_RESPONSE