Closed carmelolg closed 7 years ago
I don't understand what you mean: the module name for this angular module is intentionally left unspecified because ESM and CJS are the preferred ways of accessing the module.
Can you create a PR with your change?
Related to: https://github.com/sroze/ngInfiniteScroll#getting-started
const MODULE_NAME = 'myApplication'; angular.module(MODULE_NAME, [ngInfiniteScroll]); export default MODULE_NAME;
This code doesn't work because the module name of 1.3.4 version is infinite-scroll so imho has to be changed on
const MODULE_NAME = 'myApplication'; angular.module(MODULE_NAME, [infinite-scroll]); export default MODULE_NAME;
File ng-infinite-scroll.js row 29:
var MODULE_NAME = 'infinite-scroll';
let me know
import angular from 'angular';
import ngInfiniteScroll from 'ng-infinite-scroll';
const MODULE_NAME = 'myApplication';
angular.module(MODULE_NAME, [infinite-scroll]);
export default MODULE_NAME;
would result in:
ReferenceError: infinite is not defined
@graingert in my case it works, my version is
"ngInfiniteScroll": "^1.3.4"
File ng-infinite-scroll.js row 29:
var MODULE_NAME = 'infinite-scroll';
Maybe I badly explained myself. When you inject this dependencies on your app.module.js the correct inject is infinite-scroll and not ngInfiniteScroll.
@carmelolg as I said using angular.module(MODULE_NAME, [infinite-scroll]);
would result in:
ReferenceError: infinite is not defined
Even if infinite
and scroll
were both defined infinite-scroll
would be a Number.
Okay, but has to be a string. Change with 'infinite-scroll' let me know
when you do
import ngInfiniteScroll from 'ng-infinite-scroll';
ngInfiniteScroll // is a string;
the module name string 'infinite-scroll' is intentionally unspecified and could change at any time, without being a semver change.
okay the problem is that I'm using Angular 1.5.X and not Angular2
This project doesn't support Angular 2. It's angularjs only
So, what can I do? Now I inject 'infinite-scroll' and it works. My project is something like: angular.module('myApp', ['infinite-scroll']); with angular.module('myApp', ['ngInfiniteScroll']); doesn't work
You should use:
import angular from 'angular';
import ngInfiniteScroll from 'ng-infinite-scroll'; // this bit makes ngInfiniteScroll a string.
const MODULE_NAME = 'myApp';
angular.module(MODULE_NAME, [ngInfiniteScroll]);
export default MODULE_NAME;
I'm not agree with this declaration of module. Have to be compatible in my opinion also with standard declaration of module.
you can still use legacy JS:
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _angular = require('angular');
var _angular2 = _interopRequireDefault(_angular);
var _ngInfiniteScroll = require('ng-infinite-scroll');
var _ngInfiniteScroll2 = _interopRequireDefault(_ngInfiniteScroll);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var MODULE_NAME = 'myApp';
_angular2.default.module(MODULE_NAME, [_ngInfiniteScroll2.default]);
exports.default = MODULE_NAME;
I continue to be disagree but I will accept. Thank you.
The correct module name to inject inside module dependencies is: infinite-scroll and not ngInfiniteScroll