Skip to content

bug(directives): data.$cfg is passed but getTemplate is undefined #3410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

amcdnl
Copy link
Contributor

@amcdnl amcdnl commented Apr 24, 2017

Issue

In some cases, data.$cfg is passed but getTemplate is still undefined...if thats the case, just return out. Setting data.$cfg.getTemplate to noop does not work in this case. I suspect this is a edge case caused by a hybrid environment.

Solution

if data.$cfg.getTemplate is undefined, just return out of the loop.

Environment

  • ui-router - 1.0.0-rc.1
  • @ui-router/angular - 1.0.0-beta.5
  • @uirouter/core - 5.0.0
  • ui-router-ng1-to-ng2 - 2.0.0

@amcdnl amcdnl self-assigned this Apr 24, 2017
@amcdnl amcdnl changed the title bug(directives): data.$cfg is passed but getTemplate is still undefined bug(directives): data.$cfg is passed but getTemplate is undefined Apr 24, 2017
@hoeni
Copy link

hoeni commented May 26, 2017

Had the same warning here. The patch worked fine for me.

@Oliv
Copy link

Oliv commented May 29, 2017

The patch worked, but I don't know why in my case :

typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('angular'))

ng_from_import, meaning require('angular'), is an empty object.

If I replace :
var cfg = data.$cfg || { viewDecl: {}, getTemplate: ng_from_import.noop };
with :
var cfg = data.$cfg || { viewDecl: {}, getTemplate: angular.noop };
it is working fine.

@amcdnl amcdnl removed their assignment Aug 9, 2017
@dunecatnat
Copy link

Hello! The fix works fine for me, but wanted to find out if there are plans to merge it and include in a release any time?

@Root-Core
Copy link

Running into the same problem.. this should really be fixed. I don't know why the getTemplate() function is undefined in the first place or if this should ever happen.

[email protected]
@uirouter/[email protected]

@christopherthielen
Copy link
Contributor

Fix coming soon, thanks for your patience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants