Separate views into files?


#1

Is it possible to put the content of the <script id="page.html" type="text/ng-template"></script> inside of a separate file? I just watched a video on UIRouter and that’s how they do it, with separate files. I was thinking maybe an src attribute on the script tag but that didn’t work.

I am just curious. I can deal with one massive HTML file for my whole site but I’d like it if i could break up the template files.


#2

Our seed project is built with separate template files:


#3

okay, thanks! I feel stupid. I used another one from the code pen and it used it with the <script> tags and didn’t realize I could do this way.


#4

No prob, glad to help.


#5

I have another question.

I want the very first start page to have a logo and sign in and register buttons.
I have that looking good, then when I click on register it goes to the next page and it has a header/title bar with a back button. Now if I click the back arrow the header stays with the same information as on the registration page. How can I get rid of this?

I think I know how to just remove the back button from the header. I could do that and then have a cancel button go back to the index. Is there a better way to do that ?

Thanks again. I appreciate it! :smiley:


#6

Sorry, I’m not fully following. Probably start a new post and provide a codepen or plunkr to describe the issue. Thanks.