Javascript Angular--实例化模块失败
我正试图弄清楚应用程序的客户端。我使用Angular,当我尝试加载页面时Javascript Angular--实例化模块失败,javascript,ruby-on-rails,angularjs,Javascript,Ruby On Rails,Angularjs,我正试图弄清楚应用程序的客户端。我使用Angular,当我尝试加载页面时 Uncaught Error: [$injector:modulerr] Failed to instantiate module Facebook due to:Error[$injector:nomod] Module 'Facebook' is not available! You either misspelled the module name or forgot to load it. If re
Uncaught Error: [$injector:modulerr] Failed to instantiate module Facebook due to:Error[$injector:nomod] Module 'Facebook' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.3.0-rc.5/$injector/nomod?p0=Facebook
我已经下载并包含了angular route和angular resource,它们都是在application.js之前编译的,我已经将我的ng应用程序从html标记移动到body标记
你知道我该怎么做才能让它工作吗?让模块正常工作似乎很简单,但它拒绝这样做
-application.html.erb
<!DOCTYPE html>
<html>
<head>
<script src="/assets/angular/angular.js" type="text/javascript"></script>
<script src="/assets/angular/angular-resource.js" type="text/javascript"></script>
<script src="/assets/angular/angular-route.js" type="text/javascript"></script>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "application", media: "all" %>
<%= csrf_meta_tags %>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script>
<![endif]-->
</head>
<body ng-app="Facebook">
<div ng-controller="MainCtrl">
<%= Time.now.strftime("%m/%d/%Y") %><br>
<%= Time.now.strftime("%I:%M:%S") %>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">Titration</a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span12">
<ng-view></ng-view>
</div>
</div>
<footer>
<p>© IHSDigital 2014</p>
</footer>
</div>
</div>
</body>
</html>
我尝试过切换订单文件的加载,检查了50次拼写错误,我已经没有主意了。你的代码
javascript_include_tag "application"
正在尝试加载文件application.js,因此您的angular js文件甚至没有加载到html页面中
我不知道你的项目结构,所以我会使用
<script src="path/to/your/app.js" type="text/javascript"></script>
javascript_include_tag "application"
<script src="path/to/your/app.js" type="text/javascript"></script>
javascript_include_tag "app"