angular-rails-templates: templates are not found

前端 未结 4 961
粉色の甜心
粉色の甜心 2021-01-07 04:08

I have a rails application, using angularjs for the client side development. I try to load a template located in `app/assets/javascripts/templates/\':

myApp         


        
4条回答
  •  醉酒成梦
    2021-01-07 04:33

    try this, I hope this will worked.

     myApp.config(function ($routeProvider) {
      $routeProvider.
        when('/', {
         templateUrl: '/index.html',
         controller: 'MainController'
        }).
        otherwise({
         redirectTo: '/'
       });
    });
    

提交回复
热议问题