Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

track runtime styleUrls #432

Closed
Closed

Description

@PatrickJS

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

Activity

  1. self-assigned this
    on Jun 9, 2016
  2. changed the title [-]track styleUrls[/-] [+]track runtime styleUrls[/+] on Jun 30, 2016
  3. b091 commented on Jul 18, 2016

    @b091

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

  4. ardiadrianadri commented on Aug 26, 2016

    @ardiadrianadri

    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;
    }
    
  5. jeffwhelpley commented on Oct 3, 2016

    @jeffwhelpley
    Contributor

    @gdi2290 what is the status here?

  6. PatrickJS commented on Oct 4, 2016

    @PatrickJS
    ContributorAuthor

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

  7. dancancro commented on Jul 17, 2017

    @dancancro

    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.

  8. angular-automatic-lock-bot commented on Sep 4, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions