rails js文件在rails应用程序

时间:2017-03-06 12:11:26

标签: angularjs ruby-on-rails-3

我已经在rails中创建了一个应用程序,我编写了一个小角度示例,我已经编写了部分文件并进行了渲染。但是什么都没有加载。部分角度会有角度吗?我的代码是

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<script>
var app = angular.module("myShoppingList", []);
app.controller("myCtrl", function($scope) {
    $scope.products = ["Milk", "Bread", "Cheese"];
});
</script>

<div ng-app="myShoppingList" ng-controller="myCtrl">
  <ul>
    <li ng-repeat="x in products">{{x}}</li>
  </ul>
</div>

<p>So far we have made an HTML list based on the items of an array.</p>

</body>
</html>

输出

{{x}}
So far we have made an HTML list based on the items of an array.

我在控制台或firebug中没有收到任何错误 任何人都可以建议解决方案

0 个答案:

没有答案