templateURL content not showing


#1

I am trying to link up items from a ion-list within a tab to a detail page. I am initializing an ID to each item to differentiate the links. When I click on one of the items, the URL changes to the correct ID, but the content from the detail page does not appear. I am new to Ionic but this shouldn’t be as hard as I am making it to be.

Any advice is greatly appreciated.

Here is my code.


#2

You didn’t specify a particular template/controller in the project to illustrate your issue, but I’m guessing you haven’t specified a route to correspond to your urls. For example, in your home.html template, you have list items linking to a url `"/tab/playlists/{{agenda.id}}"``, but in app.js, none of your routes match this url pattern.


#3

Sorry, I should have been more specific. I am using the HTML files tab-sunday, tab-monday, and tab-tuesday to link up with detail.html. I checked my routes in app.js and they all seem to match my URLs, but I still can’t view my “Hello World” statement in detail.html.


#4

Your sunday-detail route is pointing to a named view (“Session”) that isn’t present on the template you are calling it from, which is why you don’t see anything happening.
Try changing your route to something like this to make the detail template appear in the main view, which is what I think you are trying to accomplish:

.state('sunday-detail/:agendaId', {
      url: "/tab/sunday-detail/:agendaId",
      templateUrl: "/templates/detail.html",
      controller: 'AppCtrl'
  })

#5

Works perfectly now! Thanks so much!