Hey there, I'm currently attempting to integrate Angular into my Rails application and unfortunately I'm encountering a problem where the HTML page shows up blank. Here's the code I have so far:
app/views/index.html.erb
<body>
<div ng-controller="MainController">
<ng-view></ng-view>
</div>
<script type="text/ng-template" id="view.html">
<div ng-controller="MainController">This is the view with some data here: {{ somedata }}</div>
</script>
</body>
assets/javascript/static.js
var app = angular.module('app', ['ngRoute']);
app.controller('MainController', function($scope) {
$scope.somedata = "This is some data!"
});
app.config(function($routeProvider) {
$routeProvider
.when('/', {templateUrl: 'view.html'})
})
application.js
//= require angular-resource
//= require angular
//= require_tree .
routes.rb
Rails.application.routes.draw do
root 'static#index'
get '*path' => 'static#index'
end
Currently, when I visit the server, all I see is a blank page without any errors. I've been using the 'angularjs-rails' gem which was working fine until I added the Angular routes. Can anyone help me identify what may be causing this issue? Thank you!