-1

Link to plunker snippet.

Code in plunker.

I'm trying to implement annyang speech recognition with videojs on AngularJS.

I have obtained a controller and service for implementing annyang on AngularJS, but I have not found how to successfully install it for my purposes.

The service and controller can be found at: https://github.com/levithomason/angular-annyang/tree/master/js

My intent is to set a controller for the speech recognition, which will set up and launch the service.

I'm getting the error: Error: $controller:ctrlreg A controller with this name is not registered.

I know I'm doing something wrong with the AyCtrl controller, but I'm not sure what it is, and other articles, while wordy, don't exactly show me what I'm doing wrong.

Thank you for your help.

4

1 回答 1

2

您的问题是您要重新创建模块 3 次。

这将创建一个模块,注意第二个参数是依赖项列表:

angular.module('myApp', ['vjs.video'])

这将检索一个已经创建的模块,只注意 1 个参数:

angular.module('myApp')

您需要创建您的模块一次,例如,在您首先加载的任何脚本中,然后每次您想向该模块注册一些东西时,只需使用它angular.module('myApp')

于 2017-09-25T14:49:09.947 回答