External template file

I download the sample code about Tabs and Navigation from ionic:

and I change one template to an external html file.
(delete about script,and add a page named “about.html”)

I can see the result in firefox,but chrome not show.

is there something I need to modify ?

What does your state provider look like? Are you pointing to them correctly?

I don’t change the code of the sample,do I need to change ?

about.html in the same folder with index.html.

.state('tabs.about', {
  url: "/about",
  views: {
    'about-tab': {
      templateUrl: "about.html"
    }
  }
})

Your template URL needs to the path relative to you index.html

templateUrl: "templates/about.html"

thanks mhartington.

I’v try,but the same.

but I found one odd thing, everything is ok on windows chrome,
but not work only on Mac chrome & Safari.

is there something wrong ?

With out actually looking at the project I can be sure. What you can do though to make sure everything is set up correctly, you can use our CLI to create a tabs starter project.

Good advice,mhartington !

I always do this way,but this time I try to download codepen sample,bad idea,ha!

anyway,thanks mhartington!

1 Like