使用ngAudio,当我在控制器中加载ngAudioObject时,我的代码似乎无法工作。我能够在视图中直接使用这些指令来处理我的wav文件(因此我知道我已经正确地链接了所有东西),而不是在控制器中。我和很多模块一起工作,想知道是否有冲突.
如果有什么明显的问题请告诉我。
var myApp = angular.module('screenApp', ['firebase','ngAudio']);
myApp.controller('screenController', ['$scope','$http','$firebaseArray','$interval', function($scope,$http,$firebaseArray,$interval,ngAudio) {
$scope.audio = ngAudio.load('sounds/dingding.wav');
...发布于 2015-04-12 01:27:16
请参阅:https://docs.angularjs.org/guide/di#inline-array-annotation
在使用这种类型的注释时,要注意保持注释数组与函数声明中的参数保持同步。
您的参数和注释数组不同步。将'ngAudio'添加到注释数组中。
myApp.controller('screenController', ['$scope','$http','$firebaseArray','$interval', 'ngAudio', function($scope,$http,$firebaseArray,$interval,ngAudio) {
$scope.audio = ngAudio.load('sounds/dingding.wav');https://stackoverflow.com/questions/29584687
复制相似问题