I'm using the latest version of IonicFramework which uses angular-ui-router 0.2.8 under the hood. This is my first time using ui-router so I'm probably making a stupid mistake, but I can't figure out what it is. When I navigate to a new state / set of views I've just added, I get a "Maximum call stack size exceeded" error and the Chrome tab crashes.
My base HTML is extremely simple:
<body ng-app="checkinApp" ng-controller="GlobalCtrl">
<nav-view></nav-view>
</body>
And here is the route config for the relevant screens:
app.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('event', {
url: "/event"
,templateUrl: "templates/event.html"
,controller: "MainCtrl"
})
.state('event.chooseEvent', {
url: "/choose"
,templateUrl: "templates/chooseEvent.html"
,controller: "MainCtrl"
})
.state('event.eventCheckin', {
url: "/checkin"
,templateUrl: "templates/eventCheckin.html"
,controller: "MainCtrl"
});
// if none of the above are matched, go to this one
$urlRouterProvider.otherwise("/event/choose");
});
Simply starting the app with the above route configuration causes the error, no other interaction is necessary.
Here are my views...
event.html:
Note the <nav-view></nav-view> block, where I'm expecting the child views to render.
<side-menus>
<!-- page content -->
<pane side-menu-content>
<header class="bar bar-header bar-positive">
<button class="button button-icon icon ion-navicon" ng-click="toggleMenu()"></button>
<h1 class="title">Checkin</h1>
</header>
<nav-view></nav-view>
</pane>
<side-menu side="left">
<content>navigation menu content here</content>
</side-menu>
</side-menus>
eventCheckin.html:
<content has-header="true" on-refresh="refreshAttendees()">
<!-- for pull to refresh -->
<refresher></refresher>
<ul class="list">
<li
ng-repeat="person in attendees | orderBy:'firstname' | orderBy:'lastname'"
item="person"
class="item item-toggle"
>
{{person.lastname}}, {{person.firstname}}
<label class="toggle">
<input type="checkbox" ng-checked="person.arrived" ng-click="toggleArrived(person)" />
<div class="track">
<div class="handle"></div>
</div>
</label>
</li>
</ul>
</content>
chooseEvent.html:
<div><br/><br/><br/>Swipe right to choose an Event</div>
Aside from the call stack infinite recursion, I'm not getting any other errors in the console. Any idea what I'm doing wrong?