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

Option "caseSensitive" breaks Angular2 templates #67

Closed
readme42 opened this issue Jul 18, 2016 · 5 comments
Closed

Option "caseSensitive" breaks Angular2 templates #67

readme42 opened this issue Jul 18, 2016 · 5 comments

Comments

@readme42
Copy link

readme42 commented Jul 18, 2016

Minifier Option case sensitive should be disabled by default, otherwise some templates written for angular2 may be broken.

@readme42 readme42 changed the title Option "caseSensitive" breaks Angular2 Code Option "caseSensitive" breaks Angular2 templates Jul 18, 2016
@hemanth
Copy link
Contributor

hemanth commented Sep 7, 2016

Any particular use-case?

@sonicoder86
Copy link

@readme42 How can i disable it?

@hemanth Any Angular 2 specific tag like ngIf and ngFor simply breaks the whole application.
This is why html-loader is not used in Angular 2 starters with Webpack (raw-loader works though, but feels hacky)

@sonicoder86
Copy link

Also removeAttributeQuotes breaks templates, because it removes quotes from link hrefs and Angular 2 template parser throws an error for it.

@ravipunjwani
Copy link

Guys, any update on this? How to use caseSensitive option for angular directives? ngIf ngFor ngClass and many others just breaking up due to lowercased html templates.

@KostyaEsmukov
Copy link

I've made html-loader work with Angular 2 templates with this config:

  {
    test: /\.html$/,
    loader: 'html-loader',
    options: {
      minimize: true,
      removeComments: true,
      collapseWhitespace: true,

      // angular 2 templates break if these are omitted
      removeAttributeQuotes: false,
      keepClosingSlash: true,
      caseSensitive: true,
      conservativeCollapse: true,
    }
  },

Some options here are redundant (they're specified in the index.js), but for the sake of withstanding future updates touching this list (like the one being proposed here 😄) I would explicitly leave them this way.

@michael-ciniawsky michael-ciniawsky self-assigned this Apr 9, 2017
umerfaruk pushed a commit to inshapardaz/desktop-client that referenced this issue Oct 4, 2017
emccorson added a commit to monaca-templates/onsenui-v2-angular2-minimum that referenced this issue May 14, 2019
emccorson added a commit to monaca-templates/onsenui-v2-angular2-navigation that referenced this issue May 14, 2019
emccorson added a commit to monaca-templates/onsenui-v2-angular2-splitter that referenced this issue May 14, 2019
emccorson added a commit to monaca-templates/onsenui-v2-angular2-tabbar that referenced this issue May 14, 2019
emccorson added a commit to monaca-templates/onsenui-v2-angular2-minimum that referenced this issue May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants