start-angular / sb-admin-angular

[DEPRECATED] Starter template / theme for AngularJS Dashboard Apps
http://startangular.com/
Other
841 stars 432 forks source link

Error: Invalid state ref '' #35

Open ChobitsSP opened 9 years ago

ChobitsSP commented 9 years ago

https://github.com/start-angular/sb-admin-angular/commit/1c7f647b8c2d116543a90637dd52a03be1e79199

https://github.com/angular-ui/ui-router/issues/395

AitorVicomtech commented 9 years ago

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 commented 9 years ago

+1

juancarloscancela commented 9 years ago

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 commented 8 years ago

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 commented 7 years ago

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