2014-04-01 28 views
0

在基於Ruby的靜態文件服務器(如Middleman和Jekyll)中,可以很容易地將頁面佈局模板和抽象視圖組件變爲部分。在Angular中是否有與ERB風格佈局/部分相同的1-1?

示例文件:layout.erb

<%= partial 'partials/document_header' %> 

<body class="<%= page_classes %> <%= data.page.page_classes %>"> 
<!--[if lt IE 10]> 
     <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> 
    <![endif]--> 
    <header class="site-header"> 
    <%= partial 'partials/nav' %> 
    </header> 
    <!-- /site-header --> 

    <main class="main-content"> 
    <%= yield %> 
    </main><!-- /main-content --> 

    <%= partial 'partials/site_footer' %> 
    <%= partial 'partials/global_footer' %> 

    <%= javascript_include_tag "public" %> 
    <%= javascript_include_tag "libs/modernizr" %> 

</body> 
</html> 

一切我看到的角度似乎對directives點帶面,說實話,感覺超架構。我需要的只是簡單的部分包含和佈局模板。什麼是reccomended方法?考慮我想抽象頁面中的幾乎所有內容,包括doctypehead標籤。

ng-include

回答

1

NG-包括NG-視圖ARE指令

,但是你沒有給他們寫,他們已經在編碼你。

入住角route.js太

有什麼reccomended的方法呢?

使用指令。

+0

我花了一段時間纔得到否認,但現在我明白了,他們很棒。 –

相關問題