Skip to content

Instantly share code, notes, and snippets.

@AlecTaylor
Created December 10, 2015 04:02
Show Gist options
  • Save AlecTaylor/0eb83c1721ae02007fd2 to your computer and use it in GitHub Desktop.
Save AlecTaylor/0eb83c1721ae02007fd2 to your computer and use it in GitHub Desktop.
Here are the relevant components of my Angular Ionic app:
### View
<!-- language: lang-html -->
<body ng-app="ionic_appname">
<ion-nav-view></ion-nav-view>
<ion-nav-view name="errorsView" title="Errors"></ion-nav-view>
### Routing
<!-- language: lang-js -->
.config(
function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('errors', {
views: {
errorsView: {
templateUrl: 'main/templates/errors.html'
}
}
})
.state('home', {
url: '/',
templateUrl: 'main/templates/home.html',
})
}
### main/templates/errors.html
<!-- language: lang-html -->
<h3>Errors ahoy</h3>
### main/templates/home.html
<!-- language: lang-html -->
<h3>Tadaima</h3>
---
However the rendered output is just:
<!-- language: lang-html -->
<body ng-app="ionic_appname" class="grade-a platform-browser platform-win32 platform-ready">
<ion-nav-view class="view-container" nav-view-transition="ios" nav-view-direction="none" nav-swipe="">
<ion-view view-title="Home" class="pane" nav-view="active" style="opacity: 1; transform: translate3d(0%, 0px, 0px);">
<h3>Tadaima</h3>
</ion-view>
</ion-nav-view>
<ion-nav-view name="errorsView" title="Errors" class="view-container" nav-view-transition="ios"></ion-nav-view>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment