【问题标题】:Browserify + angular-fullpage.jsBrowserify + angular-fullpage.js
【发布时间】:2018-08-14 22:54:20
【问题描述】:

我有一个依赖 Browserify 的应用程序。我正在尝试将 angular-fullpage.js 模块添加到我的应用程序中,但遇到了问题。这就是我的 Package.JSON 的样子:

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

我需要在 AngularJS 应用程序中使用该模块

require('angular-fullpage.js')

当我运行应用程序时,我得到:

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

有什么想法吗?

【问题讨论】:

    标签: angularjs browserify fullpage.js


    【解决方案1】:

    现在 fullpage.js 版本 3(不需要 jQuery)现在可以在官方存储库中用于 Angular: https://github.com/alvarotrigo/angular-fullpage

    希望有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-21
      • 1970-01-01
      • 1970-01-01
      • 2016-11-09
      相关资源
      最近更新 更多