Error: $controller:ctrlreg A controller with this name is not registered.


The controller with the name 'SomeController' is not registered.
名稱為'SomeController'的控制器沒注冊 ;

Description

This error occurs when the $controller() service is called with a string that does not match any of the registered controllers. The controller service may have been invoked directly, or indirectly, for example through the ngController directive, or inside a component / directive /route definition (when using a string for the controller property). Third-party modules can also instantiate controllers with the $controller()service.

當使用不匹配任何注冊控制器的字符串調用$ controller()服務時,會發生此錯誤。 控制器服務可以直接或間接地被調用,例如通過ngController指令或組件/指令/路由定義(當使用控制器屬性的字符串時)。 第三方模塊還可以使用$ controller()服務實例化控制器。

Causes for this error can be:

  1. Your reference to the controller has a typo. For example, in the ngController directive attribute, in a component definition's controller property, or in the call to $controller().
  2. You have not registered the controller (neither via Module.controller nor $controllerProvider.register().
  3. You have a typo in the registered controller name.

Please consult the $controller service api docs to learn more.

導致此錯誤的原因可能是:

您對控制器的引用有錯字。 例如,在ngController指令屬性中,在組件定義的控制器屬性中,或在$ controller()的調用中。
您尚未注冊控制器(不通過Module.controller或$ controllerProvider.register())。
您在注冊的控制器名稱中輸入錯字。
請參閱$ controller service api docs了解更多信息。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM