KiaraGrouwstra / pug-plugin-ng

A Pug plugin allowing unquoted use of Angular 2's `[(bananabox)]="val"` syntax
MIT License
24 stars 2 forks source link

Case issue #4

Closed ganySA closed 7 years ago

ganySA commented 7 years ago

Hi

I am using this library with gulp and angular cli, however something seems to be lower-casing all my directives e.g ngStyle becomes ngstyle and ngIf becomes ngif, which is breaking angular2....

my gulp file is as follows:

let path = require('path'); let gulp = require('gulp'); let pug = require('gulp-pug');

let pugFiles = './src/*/.pug';

let pug_plugin_ng = require('pug-plugin-ng'); let pug_opts = { doctype: 'html', plugins: [pug_plugin_ng] }; gulp.task('compilePug2', () => gulp.src(pugFiles) .pipe(pug(pug_opts)) .pipe( gulp.dest('./src') ) );

gulp.task('default', ['compilePug2'], () => { gulp.watch(pugFiles, ['compilePug2']); });

KiaraGrouwstra commented 7 years ago

One way I'd experienced your issue was when I'd converted html to pug using html2pug or html2jade, which output all-lowercase element names. Could it be possible that's what happened for you as well? You're saying in your pug the case remains preserved, huh?

If related, I'd consider doing a similar web page to theirs to allow converting to pug in a friendlier manner...

ganySA commented 7 years ago

Spot on. This is exactly the issue.

Thanks