External template file


#1

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 ?


#2

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


#3

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"
    }
  }
})

#4

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

templateUrl: "templates/about.html"


#5

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 ?


#6

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.


#7

Good advice,mhartington !

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

anyway,thanks mhartington!