2014-03-05 18 views
3

當我安裝了自耕農angularjs我被要求安裝一些額外的軟件包,如:ngSanitize與涼亭去除現在我得到一個ngSanitize缺少異常

  • 角航線

  • 角的sanitize

等等

現在我去掉角的sanitize搭配:

bower uninstall --save angular-sanitize 

當我開始我的index.hmtl頁面

grunt server 

然後,我的瀏覽器窗口是白/空,瀏覽器控制檯說:

Uncaught Error: [$injector:modulerr] Failed to instantiate module appApp due to: 
Error: [$injector:modulerr] Failed to instantiate module ngSanitize due to: 
Error: [$injector:nomod] Module 'ngSanitize' is not available! You either misspelled the mo...<omitted>...1) 

1)現在我問自己爲什麼我可以選擇安裝核心angular.js所需的角度插件。

2)我該如何解決這個爛攤子?我不需要ngSanitize。

+1

有棱角的核心不需要它。它是您的應用程序的一個模塊所需要的。在源代碼中刪除對此模塊的依賴關係。 –

+0

你是對的我刪除了dep。但現在我必須修復新的ui路由器的東西,因爲我刪除了ngRoute:S – msfanboy

回答

2

當您編寫角應用程序時,您可以包含模塊。

angular.module('myApp', [ 'ui.router', 'ngAnimate','ngSanitize']); 

,當您沒有依賴也裝..即:你卸載它,您也可以從應用程序模塊移走或將引發你已經列出的錯誤。您必須刪除'ngSanitize'以及.js文件以使其被卸載。

angular.module('myApp', [ 'ui.router', 'ngAnimate']); 

查看現在ngSanitize如何不再列出。在您的項目中找到並找到它並將其從模塊列表中刪除。

+0

這工作,但我仍然不得不刪除角路由模塊這是一個更多的工作;-) – msfanboy