0

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.

4

1 回答 1

1

它返回字符串,因为您只需将模块设置为应用程序的依赖项,如下所示:

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

如果你需要获取模块,你可以这样写:

angular.module(ngRedux); // Getting existing "ngRedux" module
于 2018-08-01T09:24:19.563 回答