Tom Söderlund
Tom Söderlund

Reputation: 4747

Importing ng-redux just returns a string

I have problems importing ng-redux into my JS client app:

import ngRedux from 'ng-redux';
import needle from 'needle'; // just for debugging

console.log(`Testing: `, {ngRedux, needle});

Output from console is:

Testing: {
    needle: {version: "1.6.0", defaults: ƒ, head: ƒ, get: ƒ, post: ƒ, …},
    ngRedux: "ngRedux"
}

So needle works but ngRedux just returns a string, why?

The folder node_modules/ng-redux looks just fine.

Upvotes: 0

Views: 64

Answers (1)

karaxuna
karaxuna

Reputation: 26930

It returns string, because only thing you need to do is set module as app's dependency, like this:

import ngRedux from 'ng-redux';
angular.module('app', [ngRedux]); // Creating "app" module

If you need to get module, you can write this:

angular.module(ngRedux); // Getting existing "ngRedux" module

Upvotes: 1

Related Questions