You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iknb/directives/wavesurfer.directive.js

23 lines
610 B

'use strict';
angular
.module('sloDialectsApp')
.directive('ngWavesurfer', function () {
return {
restrict: 'E',
link: function ($scope, $element, $attrs) {
$element.css('display', 'block');
var options = angular.extend({ container: $element[0] }, $attrs);
var wavesurfer = WaveSurfer.create(options);
if ($attrs.url) {
wavesurfer.load($attrs.url, $attrs.data || null);
}
$scope.$emit('wavesurferInit', wavesurfer);
}
};
});