alemangui / pizzicato

Library to simplify the way you create and manipulate sounds with the Web Audio API.
https://alemangui.github.io/pizzicato/
MIT License
1.67k stars 132 forks source link

Angular2+ compatibility #138

Open jmurowaniecki opened 4 years ago

jmurowaniecki commented 4 years ago

The class 'SoundService' cannot be created via dependency injection, as it does not have an Angular decorator. This will result in an error at runtime.

Either add the @Injectable() decorator to 'SoundService', or configure a different provider (such as a provider with 'useFactory').


I'm using Pizzicato || window['Pizzicato'] || ... in order to work around the problem, including the module on angular.json as below:

{
  ...
  "projects": {
      ...
      "architect": {
        ...
        "build": {
          ...
          "options": {
            ...
            "scripts": [
              "node_modules/pizzicato/distr/Pizzicato.min.js"
            ]
          }
...

I hope it helps someone's else.