私はRailsでangularJsを使用しており、このレイアウトを使用しています:
!!! 5
%html(lang="en"){"ng-app"=>"MyApp"}
%head
%meta(charset="utf-8")
%meta(http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1")
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
%title= content_for?(:title) ? yield(:title) : "MyApp"
= csrf_meta_tags
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
/[if lt IE 8]
= stylesheet_link_tag "application-ie", :media => "all"
= stylesheet_link_tag "application", :media => "all"
%link(href="assets/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144")
%link(href="assets/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114")
%link(href="assets/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72")
%link(href="assets/apple-touch-icon.png" rel="apple-touch-icon-precomposed")
%link(href="assets/favicon.ico" rel="shortcut icon")
%body
.container.content
.row-fluid.notifications
- if alert || notice
.span12
- if alert
.alert.alert-error= alert
- if notice
.alert.alert-info= notice
.row-fluid
.span12{"ng-view" => ""}
= yield
= javascript_include_tag "application"
= yield :javascript
私の問題は次のとおりです: Rails URL (例: Devise サインイン URL) に対して行うと、AngularJs ルートが現在のものと一致しないため、Angular js は私の利回りのすべてのコンテンツを削除します:
window.App = angular.module('MyApp', ['ngResource', 'ng-rails-csrf','ui.bootstrap']).config(['$routeProvider', '$locationProvider' ,
($routeProvider, $locationProvider) ->
#$locationProvider.hashPrefix('');
$locationProvider.html5Mode true
$routeProvider.when("/applications",
controller: 'ApplicationListCtrl'
templateUrl: '/applications.html?l=false'
)
])
どうすればそれを管理できますか?