angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.54k stars 3k forks source link

Ng_from_import may be empty #3495

Closed salJoker closed 6 years ago

salJoker commented 7 years ago

var cfg = data.$cfg || { viewDecl: {}, getTemplate: ng_from_import.noop };

Here, the Ng_from_import will have an empty value, which occurs when I use AngularJS v1.6.4, RequireJS 2.3.3, and i-ui - router v1.0.5.

heniotierra commented 7 years ago

This is happening to me too. Error occurs when using Angular 1.6.4, Require 2.1.22, ui-router 1.0.5. If I switch to older versions of these libs, everything works fine.

Error message says:

TypeError: ng_from_import is undefined

CoconutTheSlayer commented 7 years ago

@heniotierra which old versions exactly? I have the same problem

heniotierra commented 7 years ago

@CoconutTheSlayer I'm using

"angular": "~1.2.16", "angular-ui-router": "~0.2.18", "requirejs": "~2.1.14"

edeye commented 7 years ago

var cfg = data.$cfg || { viewDecl: {}, getTemplate: ng_from_import.noop };

Here, the ng_from_import will have an empty value, which occurs when I use AngularJS v1.6.6, RequireJS 2.3.3, and i-ui - router v1.0.6

edeye commented 7 years ago

@salJoker do you solved this problem?

heniotierra commented 7 years ago

@edeye @CoconutTheSlayer

This issue is duplicate of #3257 , and there christopherthielen mentions that adding the data below to the shim in your requirejs config might solve the problem. And this did solve the problem for me, with no need to use old versions of the libs.

shim: {
    'angular': { exports: 'angular' },
    'angular-ui-router': ['angular']
},