2016-05-03 2 views
0

Ich benutze Angular1.5 mit asp.net mvc.Wie ng-include erstellt URL in Angular 1.5?

standardmäßig, wenn meine Anwendung lädt sie verweist auf http://domainname/components/Webui/Home/Instructions

Startseite - Controller, Anleitung - Aktion

public class HomeController : Controller 
    {  

     public ActionResult Instructions() 
     { 
      return View(); 
     } 
    } 

oben url gibt eine HTML-

, die unter

enthält
<div> 
<div ng-include src="app/Layout/shell/Shell.html" class="height100"> 

</div> 
</div> 

Es ist jedoch nicht in der Lage, die Shell.html herunterzuladen. es erzeugt die falsche URL wie unten

http://domainname/components/Webui/Home/app/layout/shell/Shell.html

In der obigen URL warum Startseite kommt?

Meine Ordnerstruktur ist

app 
    layout 
    shell 
     Shell.html 
Controllers 
Views 
    Home 
    Index.cshtml 
    Instructions.cshtm 

Bitte korrigieren Sie mich, wenn etwas nicht stimmt.

Antwort

0

Sie verwenden einen relativen Pfad vom Index. Anfügen Schrägstrich auf Weg von dem Projekt Wurzel zu durchqueren:

ng-include src="/app/Layout/shell/Shell.html 
+0

nach dieser URL Versuch war wie this'http: // domainname/components/app/Layout/Schale/Shell.html' – Badrinarayana