mmautomatizacion / mm.angular-fullpage.js

Angular directive for use the jQuery fullPage.js library on Angular.js v1.x
MIT License
17 stars 7 forks source link

Unable to Use with Browserify #16

Open tonestrike opened 5 years ago

tonestrike commented 5 years ago

I use Browserify to build my AngularJS application.

I have an application that relies on Browserify. I am trying to add this module to my application but am having trouble. This is what my Package.JSON looks like:

"browser": {
    "mm.angular-fullpage.js": "./node_modules/mm.angular-fullpage.js/dist/mm.angular-fullpage.min.js"
},
"browserify-shim": {
    "mm.angular-fullpage.js": {
      "exports": "angular.module('fullpage.js').name",
      "depends": [
        "angular",
        "jquery"
      ]
    }
}

I require the module in the AngularJS application using

require(mm.'angular-fullpage.js')

When I run the application I get:

Failed to instantiate module portal due to:
Error: [$injector:modulerr] Failed to instantiate module {} due to:
Error: [ng:areq] Argument 'module' is not a function, got Object

Any ideas what is wrong with this?

mmautomatizacion commented 5 years ago

I'm not familiarized with browserify, but maybe it' an error in your require:

require('mm.angular-fullpage.js')

tonestrike commented 5 years ago

That was just a typo.