Skip to content
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

Error: Invalid state ref '' #35

Open
ChobitsSP opened this issue Sep 18, 2015 · 5 comments
Open

Error: Invalid state ref '' #35

ChobitsSP opened this issue Sep 18, 2015 · 5 comments

Comments

@ChobitsSP
Copy link

1c7f647

angular-ui/ui-router#395

@AitorVicomtech
Copy link

When I open the dasboard, the following error appears:

Error: Invalid state ref ''
B@http://localhost:8888/app/bower_components/angular-ui-router/release/angular-ui-router.min.js:7:23780
D/<.link@http://localhost:8888/app/bower_components/angular-ui-router/release/angular-ui-router.min.js:7:24122
J@http://localhost:8888/app/bower_components/angular/angular.min.js:53:345
f@http://localhost:8888/app/bower_components/angular/angular.min.js:46:399
J@http://localhost:8888/app/bower_components/angular/angular.min.js:53:286
f@http://localhost:8888/app/bower_components/angular/angular.min.js:46:399
J@http://localhost:8888/app/bower_components/angular/angular.min.js:53:286
C/<@http://localhost:8888/app/bower_components/angular/angular.min.js:59:454
r/h.success/<@http://localhost:8888/app/bower_components/angular/angular.min.js:70:1
ze/e/m.promise.then/u@http://localhost:8888/app/bower_components/angular/angular.min.js:97:271
ze/g/<.then/<@http://localhost:8888/app/bower_components/angular/angular.min.js:98:417
Yd/this.$get</h.prototype.$eval@http://localhost:8888/app/bower_components/angular/angular.min.js:108:478
Yd/this.$get</h.prototype.$digest@http://localhost:8888/app/bower_components/angular/angular.min.js:106:54
Yd/this.$get</h.prototype.$apply@http://localhost:8888/app/bower_components/angular/angular.min.js:109:285
e/h<@http://localhost:8888/app/bower_components/angular/angular.min.js:119:361
e@http://localhost:8888/app/bower_components/angular/angular.min.js:37:214
se/h.defer/c<@http://localhost:8888/app/bower_components/angular/angular.min.js:40:430

In angular.min.js line 89

@juancarloscancela
Copy link

+1

@juancarloscancela
Copy link

BTW, the issue is in stats.html, where link is set with an unexistent state (line 14):

´´´< a ui-sref="{{goto}}" >´´´

just removing it as (or creating a proper state in app.js) will fix the issue.

@lordliquid
Copy link

Addressing the 'invalid state ref:' error,

If anyone has problems with this, verify in your 'home.html' file that each of the elements have the goto="state.go" attribute on it. Obviously changing 'state.go' to the state you are setting to the link.
Had some trouble with that one. >< hope that saves some headaches.

In my situation there were 4 tags that did not have any state assigned and the app was expecting them there.

    <stats goto="dashboard.home" number="6" comments="Comments!" colour="primary" type="comments"></stats>
    <stats goto="dashboard.customers" number={{customers.length}} comments="Customers!" colour="primary" type="user"></stats>
    <stats goto="dashboard.home" number="18" comments="New orders!" colour="yellow" type="shopping-cart"></stats>
    <stats goto="dashboard.home" number="24" comments="Support tickets!" colour="red" type="support"></stats>

I set 'dashboard.home' to the three that I have not implemented yet so that I would no longer receive the error.

@dhkundan
Copy link

I was also having the same issue.
Just add false to goto expression.
<a ui-sref="{{goto || false}}">

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

No branches or pull requests

5 participants