我用角與我application.html.erb
在app/views/layout
文件夾中的Rails應用程序&看起來是這樣的:NG-視圖重複寫的是什麼,我application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Fmtemp</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= csrf_meta_tags %>
</head>
<body ng-app="fmview">
<%= yield %>
<%= javascript_include_tag "application" %>
</body>
</html>
我命名另一個文件夾: app/views/fmtest
具有index.html
編碼爲:
<h1> Greetings from FMView App </h1>
<a href="#/list"> List </a>
<a href="#/grid"> Grid </a>
<div ng-view></div>
我的應用程序的
現在HTML渲染是很奇怪:
<html>
<head>
<style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\:form{display:block;}</style>
<title>Fmtemp</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css">
<link href="/assets/fmview.css?body=1" media="all" rel="stylesheet" type="text/css">
<meta content="authenticity_token" name="csrf-param">
<meta content="Vwo3zN2lK8hvLPQcV3llnGnvgNqCLaHHsBubSRaYueg=" name="csrf-token">
<style type="text/css"></style></head>
<body ng-app="fmview" class="ng-scope" style="">
<h1> Greetings from FMView App </h1>
<a href="#/list"> List </a>
<a href="#/grid"> Grid </a>
<!-- ngView -->
<div ng-view="" class="ng-scope">
<title>Fmtemp</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css">
<link href="/assets/fmview.css?body=1" media="all" rel="stylesheet" type="text/css">
<meta content="authenticity_token" name="csrf-param">
<meta content="Vwo3zN2lK8hvLPQcV3llnGnvgNqCLaHHsBubSRaYueg=" name="csrf-token">
<h2>List View Welcomes you</h2>
<script src="/assets/angular-1.2.js?body=1" type="text/javascript"></script>
<script src="/assets/angular-route.min.js?body=1" type="text/javascript"></script>
<script src="/assets/fmview.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
</div>
<script src="/assets/angular-1.2.js?body=1" type="text/javascript"></script>
<script src="/assets/angular-route.min.js?body=1" type="text/javascript"></script>
<script src="/assets/fmview.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
</body>
</html>
這些JS和Sylesheets被一次又一次地包含在內。
現在,當我嘗試包括任何頁眉或任何代碼在我application.html.erb
這只是內部ng-view
格重複被...
試圖在這裏和那裏走動<yield>
但它是一樣的,有問題的。
你的意思是:嘗試使整個HTML頁面爲Angular的fmview App? – mayankcpdixit