Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track runtime styleUrls #432

Closed
PatrickJS opened this issue Jun 9, 2016 · 6 comments
Closed

track runtime styleUrls #432

PatrickJS opened this issue Jun 9, 2016 · 6 comments
Assignees

Comments

@PatrickJS
Copy link
Member

PatrickJS commented Jun 9, 2016

track runtime styleUrls. for webpack use angular2-template-loader

@b091
Copy link

b091 commented Jul 18, 2016

nice to have? So right now angular universal is only for angular using webpack?

@ardiadrianadri
Copy link

Hello:

How is this issue? I don't know if it is related but, when I add a url style I get the next error in the browser:

browser_adapter.js:84EXCEPTION: TypeError: s.replace is not a functionBrowserDomAdapter.logError @ browser_adapter.js:84
browser_adapter.js:84STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.js:84
browser_adapter.js:84TypeError: s.replace is not a function
    at Function.StringWrapper.replaceAllMapped (http://localhost:3000/dist/app.bundle.js:34796:19)
    at Object.extractStyleUrls (http://localhost:3000/dist/app.bundle.js:40490:49)
    at http://localhost:3000/dist/app.bundle.js:48485:58
    at Array.map (native)
    at DirectiveNormalizer.normalizeStylesheet (http://localhost:3000/dist/app.bundle.js:48484:44)
    at DirectiveNormalizer.normalizeLoadedTemplate (http://localhost:3000/dist/app.bundle.js:48424:44)
    at DirectiveNormalizer.normalizeTemplateSync (http://localhost:3000/dist/app.bundle.js:48410:22)
    at DirectiveNormalizer.normalizeDirective (http://localhost:3000/dist/app.bundle.js:48386:44)
    at RuntimeCompiler._getCompiledTemplate (http://localhost:3000/dist/app.bundle.js:47319:189)
    at RuntimeCompiler._getTransitiveCompiledTemplates (http://localhost:3000/dist/app.bundle.js:47327:81)BrowserDomAdapter.logError @ browser_adapter.js:84
zone.js:260Uncaught TypeError: s.replace is not a function

This is the code of my component:

import { Component, OnInit} from '@angular/core';
import {ROUTER_DIRECTIVES} from '@angular/router';

import {Menu} from './menu';
import {MenuService} from './menu.service';

@Component({
    selector:'my-menu',
    templateUrl:'../templates/menu.html',
    styleUrls: ['../templates/menu.css'],
    directives: [ROUTER_DIRECTIVES]  
})
export class MyMenu implements OnInit{
    public menuConfig: Menu;

    constructor(private menuService:MenuService){}

    private _getConfig(){
        this.menuService.getConfig().then(data => {
            console.log(JSON.stringify(data));
            this.menuConfig = data
        })
        .catch(error => {throw new Error(error)});
    }

    ngOnInit(){
        this._getConfig();
    }
}

And this is the css code of menu.css:

nav {
    background-color: red;
}

@jeffwhelpley
Copy link
Contributor

@gdi2290 what is the status here?

@PatrickJS
Copy link
Member Author

PatrickJS commented Oct 4, 2016

we can close this. Developers should use webpack and angular2-template-loader

@dancancro
Copy link

Removing keepUrl=true from angular2-template-loader?keepUrl=true in generator-jhipster generated code solved this problem for me that started after I refactored my app and moved things around. Maybe something else would have fixed it but the angular2-template-loader instructions say to use this option with file-loader which I'm not doing with template or style files. I'll update this if I find another way.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants