Closed xenit-raven closed 8 years ago
Neat. Will check it out soon.
I'd be an interesting addition if you could transform the variable in the template. For example by adding a callback on the resolved variable:
options {
htmlModuleTemplate: '<%= filename %>'
}
This option would now convert example-page.tpl.html
to the module examplePage.tpl
, which currently clashes with my directive called examplePage
.
Foolishly, I tried performing regex on the template variable
options {
htmlModuleTemplate: '<%= filename %>'.replace(/\.tpl/,'')
}
which of course only acts on the string '<%= filename %>'
.
would welcome this fix, because I am using also john papa's guide and many of my templates have dashes, for now I am not able to use this html template compile feature
Sorry for sitting on this. I'm finally done with my Pluralsight course so I should have some time to review this soon.
Thanks very much for contributing!!
When compiling html files with names containing dashes, the compile function creates invalid ts output.
I've started using dashes in my file names as suggested by JohnPapa's style guide. This pull request is inspired by https://github.com/TypeStrong/grunt-ts/pull/237
Options used:
Example:
example-page.tpl.html
->example-page.tpl.html.ts
Outputs
With compile errors:
Dashes are not accepted as variable (and module) names, so I added a fix that would convert a dash to camelCase. I've also added the relevant tests. I hope my contribution is correct and useful!