Support Root Namespace Imports for Components
See original GitHub issueI have a shared component library where each micro component has it’s own namespace. In previous versions of blazor it was possible to use the taghelper to import such components with a root namespace. Now with the preview4 version i have to specify each namespace in the _Include file or on each page i’d like to use such a shared component.
Is there any plan to add a more generic solution for such imports or at least a better auto resolve on the page level? Because without the using declaration the component will not be rendered.
@addTagHelper *, My.Components
@using My.Components.ComponentA
@using My.Components.ComponentB
@using My.Components.ComponentC
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Support Root Namespace Imports for Components #9569
I have a shared component library where each micro component has it's own namespace. ... Support Root Namespace Imports for Components #9569.
Read more >Is there a way to import all blazor components within a root ...
c# - Is there a way to import all blazor components within a root level namespace between razor class libraries? - Stack Overflow....
Read more >Add or remove imported namespaces (Visual Basic)
To add a user import · In Solution Explorer, double-click the My Project node for the project. · In the Project Designer, click...
Read more >Documentation - Namespaces
Another way that you can simplify working with namespaces is to use import q = x.y.z to create shorter names for commonly-used objects....
Read more >Documentation - Namespaces and Modules
This post outlines the various ways to organize your code using modules and namespaces in TypeScript. We'll also go over some advanced topics...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We plan to support
@namespace
for preview 6 https://github.com/aspnet/AspNetCore/issues/8007The issue here is that for C# classes you can nest them in different folders but keep a single (simple) namespace. For components, the namespace is being autogenerated based on the path, which is fine, but it would be nice to be able to specify the namespace manually too.
MyModule/Components/HelloWorld/Hello.razor