Skip to content

how do you dynamically update index.html via the angular CLI build? #7824

@jordan112

Description

@jordan112

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X] feature request

Versions

cli 1.4.3
node: v7.6.0
npm: 4.1.2

Desired functionality

The CLI generates a index.html file. There are various places in that file that I need to dynamically update. Is there a way to do this using the Angular CLI build process?

###Use cases

  • Internationalization: i18n has not access into the index.html, only the components beneath it. How do you dynamically bring in messages, such as "loading..." in other languages?

  • The tag requires lang="en", etc. I could hard code en, but I have 12 different languages and I need to have the proper locale-id loaded in that attribute. We use AOT and generate 12 different static sites using all built in CLI

  • HTML page title: This requires different languages as well, but don't know how to get them there. There is the Title service, but that wasn't working for me. https://angular.io/api/platform-browser/Title

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions