Closed omatrot closed 5 years ago
Instead of creating a separate IHbsBlockHelperService
, I would suggest you instead update the IHbsHelperService
interface by adding a BlockHelpers
properties and a RegisterBlockHelpers
method.
Sure. Will do.
We will also need some sort of test for this. So perhaps you could update the ScaffoldingSample project to add a Handlebars block helper.
No need to close the pull request. Just update the code and push.
Right, just on more thing: About the HbsHelperService constructor, should it take another parameter or should I create another constructor that takes a blockHelpers parameter?
Just add a blockHelpers parameter to the existing constructor.
Would you like to have 2 methods: AddHandlebarsHelpers AddHandlebarsBlockHelpers
Because they're adding a singleton, the last one wins, and the helpers added in the previous call are lost. Unless there is another way that I'm unaware off right now.
Now that I've thought about it more, it's cleaner to just have a separate IHbsBlockHelperService
service, the way you proposed. We can then have two methods: AddHandlebarsHelpers
and AddHandlebarsBlockHelpers
.
Does it mean that I have nothing more to do?
Just rename the AddHandlebarsHelpers
method, then update the ScaffoldingSample or ScaffoldingSample.TypeScript project to add a Handlebars block helper, so that we can validate that it works as expected.
I've pushed the code.
@omatrot Just a couple very small corrections, and I'll go ahead and merge the PR.
following our discussion in this issue