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

doesn't work with angular2, [] and () html syntax #2

Open
ghost opened this issue Nov 19, 2015 · 3 comments
Open

doesn't work with angular2, [] and () html syntax #2

ghost opened this issue Nov 19, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 19, 2015

No description provided.

@jserme
Copy link
Owner

jserme commented Dec 11, 2015

@robertbaker can you give some example code?

@Cotspheer
Copy link

Hi there.

I saw this issue is still unresolved and I face the same issue. My error output is following:

Process terminated with code 8.
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Parse Error: <li *ngFor="#stroke of service.strokes; #istroke = index" [class.animated]="istroke == service.strokes.length - 1" [class.fade-in]="istroke == service.strokes.length - 1">
            <a href="#">
                <span>{{stroke}}</span>
            </a>
        </li>
    </ul>
</div>

The HTML-File where the error is thrown looks like this:

<div id="breadcrumbs">
    <ul class="list-inline">
        <li *ngFor="#stroke of service.strokes; #istroke = index" [class.animated]="istroke == service.strokes.length - 1" [class.fade-in]="istroke == service.strokes.length - 1">
            <a href="#">
                <span>{{stroke}}</span>
            </a>
        </li>
    </ul>
</div>

My gulpfile pretty much looks like this:

var __gulp = require("gulp");
var __minifyHtml = require("gulp-htmlmin");

[...]

var htmlOptions = {
        caseSensitive: true,
        removeComments: true
    };

__gulp
        .src(source)
        .pipe(__minifyHtml(htmlOptions))
        .pipe(__gulp.dest(dest));

That's all information which I could provide. Do you have any idea what I`m doing wrong?

@anderflash
Copy link

But [] () and {{}} are not HTML syntax. These are Angular2 Templating system. IMHO, htmlmin should be used after transpiling them to HTML. The problem is: Angular2 doesn't transpile them to HTML, they put inside the JS file to get the SPA effect. So, htmlmin is not the right tool, neither it doesn't do any effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants