I created a angularjs project with angular material.I added phantom js for seo to create html file for each page.My code,
var page = require('webpage').create();
page.open('http://website.com/', function (status) {
if (status !== 'success') {
console.log('Unable to access network');
} else {
var p = page.evaluate(function () {
return document.getElementsByTagName('html')[0].innerHTML
});
fs.write('home.html', page.content, 'w');
}
phantom.exit();
});
page.onError = function (msg, trace) {
console.log('msg', msg);
trace.forEach(function(item) {
console.log(' ', item.file, ':', item.line);
});
}
After creation of html file, when I open the file in browser, the css is not getting applied and the design gets collapsed.Here is the screenshot of the issue.
Could anyone suggest me what is the issue?Is it because I use angular material?