ruby - angularjs rails routing doesnt work -
i'm having problems when try load angular views in rails app. if in page `{{1+3}} gives me correct result 4. believe routes
following stack
angular 1.2.20
angular-ui-router (latest)
rails 4.1.1
following files
#app/assets/javascript/app.js angular .module('app', ['ui.router']) .config(function($stateprovider, $urlrouterprovider, $locationprovider){ $urlrouterprovider.otherwise("/home"); $stateprovider .state('home',{ url: 'home', template: "<h1>test</h1>" }); $locationprovider.html5mode(true); }); #app/views/layout/application.html.erb # please note have added 'app' in body tag <div ng-view> <%= yield %> </div> #config/routes #please note have controller called home root 'home#index' '*path' => 'home#index'
what i'm expecting when go http://localhost:3000
should see 'test' inside div. not happening , there no errors in js console well. appreciated
Comments
Post a Comment