Menelaos
Menelaos

Reputation: 26549

Trying to use angular-recorder, getting controller not found

I am trying to use angular-recorder from https://github.com/logbon72/angular-recorder

  Controller 'ngAudioRecorder', 
required by directive 'ngAudioRecorderAnalyzer', can't be found!

I have done bower-install and added the file to the dependencies. I am getting the above error when I try to use <ng-audio-recorder-analyzer></ng-audio-recorder-analyzer>

Update

As Y.Puzyrenko states, need to enclose a <ng-audio-recorder-analyzer> inside a <ng-audio-recorder> for recorder controller object to be available.

Code that works:

<ng-audio-recorder id='audioInput' audio-model="recorder.audioModel">
    <!-- Start controls, exposed via recorder-->
        Current microphone input:
        <ng-audio-recorder-analyzer  ng-model="a.audioModel"></ng-audio-recorder-analyzer>
        <button ng-click="recorder.startRecord()" type="button" ng-disabled="recorder.status.isRecording" class="btn btn-default">
            Start Record
        </button>
        <button ng-click="recorder.stopRecord()" type="button" ng-disabled="recorder.status.isRecording === false" class="btn btn-default">
            Stop Record
        </button>
        <button ng-click="recorder.playbackRecording()" type="button"
         ng-disabled="recorder.status.isRecording || !recorder.audioModel" class="btn btn-default"> Playback
        </button>
    <!-- End controls-->
</ng-audio-recorder>

Upvotes: 1

Views: 841

Answers (1)

Y.Puzyrenko
Y.Puzyrenko

Reputation: 2195

This problem occurs 'cause you did'nt specify ng-audio-recorder directive on your element, or it's parent. E.g. <ng-audio-recorder><ng-audio-recorder-analyzer></ng-audio-recorder-analyzer></ng-audio-recorder>

Docs

Upvotes: 1

Related Questions