lundi 6 mars 2017

angular js files are not loaading in rails application

I have created an application in rails , i have written small angular example , I have written in partial file and rendered it. But nothing is loading. Will angular work in partials? my code is

<!DOCTYPE html>
<html>
<script src="http://ift.tt/1Re4n6G"></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"></li>
  </ul>
</div>

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

</body>
</html>

And the output is


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

Can anybody suggest solution

Aucun commentaire:

Enregistrer un commentaire