Added Docker stuff.
This commit is contained in:
23
directives/wavesurfer.directive.js
Normal file
23
directives/wavesurfer.directive.js
Normal file
@@ -0,0 +1,23 @@
|
||||
'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);
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user