thenikso / angular-inview

AngularJS directive to check if a DOM element is in the browser viewport.
http://thenikso.github.io/angular-inview/
MIT License
480 stars 112 forks source link

Export the name of the module for npm #89

Closed InsidersByte closed 8 years ago

InsidersByte commented 8 years ago

For the npm package it would be useful if it exported the name of the module. For examples angular messages below.

require('./angular-messages');
module.exports = 'ngMessages';

This would allow you someone to do this.

import inView from 'angular-inview';

const appModule = angular.module('app', [inView]);

export default appModule.name;
thenikso commented 8 years ago

the module itself is exported. so what you can do is:

import ngInview from 'angular-inview';

const appModule = angular.module('app', [ngInview.name]);