0

我正在處理ASP.NET Web窗體應用程序。我已經添加了一些角度控制器和其他角度funcatinlity應用程序。現在我需要應用JS和CSS文件的縮小,我試圖通過System.Web.Optimization dll來使用構建的捆綁提供程序。 在angular.js和我的角碼代碼文件上應用捆綁時出現錯誤。我不理解是什麼導致錯誤。捆綁不起作用angularJS

collection.Add(new ScriptBundle("~/bundles/startupbundle") 
       .Include("~/Scripts/jquery-2.1.0.js") 
       .Include("~/Scripts/jquery-ui-1.10.4.min.js") 
       .Include("~/Scripts/jquery-migrate-1.2.1.min.js") 
       .Include("~/Scripts/bootstrap.min.js") 
       .Include("~/Scripts/modernizr-2.7.2.js") 
       .Include("~/Scripts/jquery.blockUI.min.js") 
       .Include("~/Scripts/select2.mi![enter image description here][1]n.js") 
       .Include("~/Scripts/jquery.nicescroll.js") 
       .Include("~/Scripts/jquery.smartWizard.js") 
       .Include("~/Scripts/scripts.js") 
       .Include("~/Scripts/kendo.all.min.js") 
       .Include("~/Scripts/toastr.min.js") 

       .Include("~/Scripts/underscore-min.js") 

       .Include("~/Scripts/bootstrap.min.js") 

       .Include("~/WebApp/AppScripts/master-page.js") 
       .Include("~/WebApp/AppScripts/Dasboard.js") 
       .Include("~/Scripts/angular.min.js") 
       ); 

enter image description here

回答

0

看來,你包括你的自定義腳本包括角。你需要首先包含Angular,否則你會得到運行時錯誤。

段:

... // everything above this as before 
.Include("~/Scripts/angular.min.js") 
.Include("~/WebApp/AppScripts/master-page.js") 
.Include("~/WebApp/AppScripts/Dasboard.js") 
); 

儘管很難從你的截圖告訴我們,如果是這種情況。如果我的提示不起作用,請使用另一個屏幕截圖來更新您的問題,以顯示「Uncaught object」展開(按下它的左側三角形)。

作爲一個附註,你應該在頁面的頂部包含Modernizr,所以它不應該在這個包中。