I'm really sorry if this question have already been answered, but I'm not able to express it shortly.
I have a file named Html.js, it give default HTML values to ejs. It also have some prototypes wich allow us to add some content to it before sending. The css part is shown below.
var Html = {
css_required : [
{url : 'https://fonts.googleapis.com/css?family=Muli'},
{url : 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'}]
}
Html.prototype.addCss = function (cssToAdd){
cssToAdd.forEach(function(cssUrl){
Html.head.css_required.push(cssUrl);
})
};
module.exports = Html;
The fact is that when I use the addCss property like this :
var html = require('../models/Html');
html.prototype.addCss([{url : myConst.WEB_CSS + "dropzone.css"}]);
content = {html : html};
ejs.renderFile(_ViewDir + 'uploadVideoView.ejs',content,{},function(err, fileContent) {
if(err){
callback(err,null);
}
else{
callback(null,fileContent);
}
})
Then, when I press F5 or whatever, it keeps the previous "pushed" value of the Html module... I get one, then twice, then three times, etc, the css of dropzone.
Is it normal ? Where the problem may come from ?
Thanks
via nicolay1
No comments:
Post a Comment