This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support @Inject, @model, @using declaration in viewstart #881
Comments
pranavkm
added a commit
that referenced
this issue
Aug 6, 2014
pranavkm
added a commit
that referenced
this issue
Aug 16, 2014
pranavkm
added a commit
that referenced
this issue
Aug 19, 2014
pranavkm
added a commit
that referenced
this issue
Aug 20, 2014
yishaigalatzer
changed the title
Propogate directives declared in _ViewStart pages to items under it.
Support @Inject, @model, @using declaration in viewstart
Sep 29, 2014
I had this working a very long time ago but have upgraded my sln to dnx and MVC6 beta4 and no the @Inject on a _ViewStart page doesn't seem to propagate to views using it. It could be something I'm doing wrong or is it a known issue? |
@Shazwazza we added a new file |
great thanks, will give it a try |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Related discussion: #825
The plan is to have any directives declared in _ViewStart affect pages in the hierarchy. For instance
@using MyNamespace
declared in the root _ViewStart wouid cause ausing MyNamespace;
to be generated in all views in the application.The merge strategy happens on a per-directive basis - for instance for @Inject are merged by name
@inject FooType Html
in _ViewStart and@inject BarType Html
in the page would result in the latter being chosen.The token
TModel
would represent the model of the current page. When adding a directive to a page, the token would be replaced by the value specified by @model.The text was updated successfully, but these errors were encountered: