각도가있는 레일에 각도 뷰를 만들려면 디렉터리 /app/assets/javascripts/angular/templates
을 만듭니다.각도로 라우팅이 작동하지 않습니다.
내 route.js.coffe
app.config ($routeProvider) ->
$routeProvider
.when('/task', {
templateUrl: 'templates/task/index.html'
controller: 'TaskCtrl'
})
내 index.slim
.container
h2
|What would you like to do?
a href="#/watchlist"
| Watchlist
|   or  
a href="#/task"
| Task
div class="row" ng-view=""
내가 링크 "작업"아무 일도 발생하지 않습니다 클릭
. 나는 콘솔에 다음과 같은 메시지가 표시은 (2014년 8월 29일 8시 49분 17초 -0300 ActionController :: RoutingError에서 192.168.1.106은 "/templates/task/index.html을"GET 시작 어떤 경로 일치 [얻을] "/templates/task/index.html") :
내 index.html을 :
<div ng-controller="TaskCtrl">
<h2>teste</h2>
</div>
내 route.rb
Rails.application.routes.draw do
get 'home/index'
scope :api, defaults: {format: :json} do
resources :tasks
resources :stocks
end
root 'home#index'
end
어떻게 응용 프로그램을 응용 프로그램에 바인딩하고 있습니까? – Malkus