Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Feature Request/Question: Ability to easily author/inject new directives for Razor? #7540

Closed
ghost opened this issue Mar 24, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 24, 2018

Currently, I cannot find an easy way to author/inject custom directives into Razor whilst using ASPNET Core Mvc(Kestrel).

I can see that the @Inject directive gets registered within razor here. Now if I wanted to inject a custom directive to MVC on startup how would I achieve that easily? Imagining for a second I wanted to create a '@FooInjector'.

I can see you offer access to RazorViewEngineOptions is this potentially where you guys would expose something like this?

@rynowak
Copy link
Member

rynowak commented Mar 25, 2018

We plan on enabling this kind of thing once we have support for it in tooling.

While it would be possible for us to provide support for this in the runtime/compiler right now, the tools would not understand the new directives and would produce errors.

@mkArtakMSFT
Copy link
Member

@rynowak, do we have a separate issue tracking this work, or should we use this one for tracking?

@rynowak
Copy link
Member

rynowak commented Mar 26, 2018

We don't have an issue for it, but its on our roadmap and planning documents.

If you're deeply passionate about having an issue for it, then Razor repo is the right place to track.

@mkArtakMSFT
Copy link
Member

This issue was moved to aspnet/Razor#2234

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

No branches or pull requests

2 participants