MarkPieszak / universal-es6-starter

[Deprecated] Angular 2+ ES6 Universal Webpack Babel starter
5 stars 2 forks source link

Home&Todo refresh page - Universal styleshost error - Breaks client #2

Open MarkPieszak opened 7 years ago

MarkPieszak commented 7 years ago
Unhandled Promise rejection: Cannot read property 'push' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read  property 'push' of undefined

var UniversalModule = (function () {
    function UniversalModule(sharedStylesHost) {
        var domStyles = document.head.querySelectorAll('style');
        var styles = Array.prototype.slice.call(domStyles)
            .filter(function (style) { return (style.innerText || style.textContent).indexOf('_ng') !== -1; })
            .map(function (style) { return (style.innerText || style.textContent); });
        styles.forEach(function (style) {
            sharedStylesHost._stylesSet.add(style);
            sharedStylesHost._styles.push(style); // <-- _styles doesn't exist
        });
    }