我正在將我的rails 4.2.0應用升級到5.1.2,這很順利。我曾使用Angular 1.x來選擇性地增強我的rails應用程序頁面。我的rails視圖在HAML中。這裏是一個在4.2.0精加載頁面的摘要,但沒有在5.1.2:從rails升級到rails 5.1.2 4.20中斷角集成
.well{"ng-app" => "billing", "ng-controller" => "BillableCtrl"}
= simple_form_for @billable do |f|
.row
.col-md-4
這將加載在該視圖的角度罰款。不過,當我嘗試在Rails 5.1.2中加載時,我在我的JavaScript控制檯中得到了以下堆棧跟蹤。
Uncaught SyntaxError: Unexpected token & angular.self-26d045c60a96c782aa8ef9f5709b1b4fd1ec8578bc37ec2c6c2b9c4370f4bac0.js?body=1:64 Uncaught Error: [$injector:modulerr] Failed to instantiate module billing due to: Error: [$injector:nomod] Module 'billing' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
我在rails 5.1.2升級中使用ngannotate-rails version 1.2.2。 rails 4.2.0版本中使用的ngannotate-rails版本是0.15.4。
有沒有其他人遇到過這個問題?有什麼選擇要調查?